[ 
https://issues.apache.org/jira/browse/LUCENE-7844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16024765#comment-16024765
 ] 

Timothy M. Rodriguez commented on LUCENE-7844:
----------------------------------------------

+1 on the comparator use.  That definitely cleaned up some code.

I'm a bit uncertain on the maxPassages change, however.  I think it may be 
pretty common to pivot the number of passages required per field.  For example, 
a user may want to highlight a title fully (one passage) and get several 
passages from the primary content field.  The motivation to get rid of the 
parallel arrays makes a lot of sense, maybe we could try to lump all these 
options into an object per field?  For lack of a better name something like 
FieldOptions[] or the like?  Longer term, I could even see options for the 
break iterator, scorer, and formatter being configured per field.  (In the 
previous example, it may be better to have a dummy iterator that chunks on 
value delineations, a noop scorer, and a formatter that just returns the entire 
stored value for the title, while the content would have more traditional 
options.  I know this is all still possible with overrides in the current 
design, but I'm not sure we should push it further into the "specialized" 
use-case area. What do you think?


> UnifiedHighlighter: simplify "maxPassages" input API
> ----------------------------------------------------
>
>                 Key: LUCENE-7844
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7844
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>            Reporter: David Smiley
>            Priority: Minor
>             Fix For: master (7.0)
>
>         Attachments: LUCENE_7844__UH_maxPassages_simplification.patch
>
>
> The "maxPassages" input to the UnifiedHighlighter can be provided as an array 
> to some of the public methods on UnifiedHighlighter.  When it's provided as 
> an array, the index in the array is for the field in a parallel array. I 
> think this is awkward and furthermore it's inconsistent with the way this 
> highlighter customizes things on a by field basis.  Instead, the parameter 
> can be a simple int default (not an array), and then there can be a protected 
> method like {{getMaxPassageCount(String field}} that returns an Integer 
> which, when non-null, replaces the default value for this field.
> Aside from API simplicity and consistency, this will also remove some 
> annoying parallel array sorting going on.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to