You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Ricci Gian Maria (JIRA)" <ji...@apache.org> on 2012/08/28 19:54:10 UTC

[jira] [Created] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Ricci Gian Maria created LUCENENET-505:
------------------------------------------

             Summary: FastVectorHighlighter create fragment only with match at the beginning
                 Key: LUCENENET-505
                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
             Project: Lucene.Net
          Issue Type: Improvement
          Components: Lucene.Net Contrib
    Affects Versions: Lucene.Net 2.9.4g
            Reporter: Ricci Gian Maria
            Priority: Minor


When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 

Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());

The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ricci Gian Maria updated LUCENENET-505:
---------------------------------------

    Attachment: PatchForSimpleFragListBuilder.patch

This is the correct patch that add fragment positioning and three test to test 0, 0.5 and 1 positioning.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch, PatchForSimpleFragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444104#comment-13444104 ] 

Ricci Gian Maria commented on LUCENENET-505:
--------------------------------------------

I've enclosed a second patch, it is an alternative patch that uses a float value between 0 and 1. I've done against the trunk this time.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ricci Gian Maria updated LUCENENET-505:
---------------------------------------

    Attachment: PatchForSimpleFragListBuilder.patch

Second patch that uses a float value to specify positions.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch, PatchForSimpleFragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Simon Svensson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443417#comment-13443417 ] 

Simon Svensson commented on LUCENENET-505:
------------------------------------------

The patch basically introduces a code path where start = phraseInfo.StartOffset - halfSize instead of start = phraseInfo.StartOffset - MARGIN.

How about introducing a new parameter to CreateFieldFragList that specifies the leftMargin to use? Passing leftMargin=0 would cause current behavior, leftMargin=fragCharSize/2 would cause the requested behavior, and leftMargin=fragCharSize would return fragments with matches at the end.

We could pass a float 0..1 instead of actual characters if that would be easier to read/code.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Christopher Currens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447120#comment-13447120 ] 

Christopher Currens commented on LUCENENET-505:
-----------------------------------------------

I'm not so sure this should be part of the SimpleFragListBuilder.  All of a sudden, that class is no longer "simple", not to mention that it might make porting a bit more difficult.

It seems to make more sense to have a new class whose name infers that it will grab fragments that match from any position in the term.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch, PatchForSimpleFragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ricci Gian Maria updated LUCENENET-505:
---------------------------------------

    Attachment:     (was: PatchForSimpleFragListBuilder.patch)
    
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444025#comment-13444025 ] 

Ricci Gian Maria commented on LUCENENET-505:
--------------------------------------------

Actually the patch is a really simple boolean property passed in another constructor of the SimpleFragListBuilder to specify if we want match in the middle, but it can be also feasible to insert a property in SimpleFragListBuilder called "LeftMargin". The default value is zero so it does not introduce any problem in already existing code, if you want I can create this patch against 3.0.3 branch.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447297#comment-13447297 ] 

Ricci Gian Maria commented on LUCENENET-505:
--------------------------------------------

It makes sense, as soon as possible I'll change the patch to add a complete new class.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch, PatchForSimpleFragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LUCENENET-505) FastVectorHighlighter create fragment only with match at the beginning

Posted by "Ricci Gian Maria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ricci Gian Maria updated LUCENENET-505:
---------------------------------------

    Attachment: FragListBuilder.patch

Patch to implement hilight with the match in the middle.
                
> FastVectorHighlighter create fragment only with match at the beginning
> ----------------------------------------------------------------------
>
>                 Key: LUCENENET-505
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-505
>             Project: Lucene.Net
>          Issue Type: Improvement
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 2.9.4g
>            Reporter: Ricci Gian Maria
>            Priority: Minor
>         Attachments: FragListBuilder.patch
>
>
> When you use FastVectorHighlighter fragments returned have the match at the beginning. In most situation it is much more useful to create fragments with the match in the middle. I've included a really trivial patch to enable this with a specialized constructor of the SimpleFragListBuilder 
> Es: FastVectorHighlighter hilighter = new FastVectorHighlighter(true, true, new SimpleFragListBuilder(true), new SimpleFragmentsBuilder());
> The true parameter to SimpleFragListBuilder is named matchInTheMiddle so it has a descriptive name. Probably it would be useful to create an enum to place the match at: beginning, middle, end.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira