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

David Smiley commented on SOLR-8583:
------------------------------------

This is looking *much* better -- nice job Jan!  That FvhContainer is perfect; 
I'm kicking myself for not thinking of that already.

The test exhibits a problem related to not using hl.requireFieldMatch.  Looking 
at the test, I see we have a query on tv_text yet we're asking to highlight 
t_text (falling back on tv_text as alternate).  What we assert is sensible 
based on these args, but this is an unnatural example.  A more natural example 
is that the query is on t_text -- the same field that is highlighted.  What 
should then happen?  Well, we could try and make it work by setting 
hl.requireFieldMatch=false or we could demand that this be set as a 
prerequisite to highlighting alternate fields.  Or we could leave the logic be 
and document that you most likely need to set this to false (what I'm kinda 
leaning to but I have no conviction).  Note that FVH doesn't support per-field 
overrides of that setting, so if we try to set that ourselves, then it won't 
work with FVH.  How to handle this is debatable. In any case, the tests should 
be expanded to query based on t_text in addition to what it tests now which is 
good to test too.

Minor quibbles:
* can you order the parameters to doHighlightingOfField to have more 
consistency with the other methods that take much of the same parameters: doc, 
docId, schemaField, fvhContainer, query, reader, req


> Apply highlighting to hl.alternateField
> ---------------------------------------
>
>                 Key: SOLR-8583
>                 URL: https://issues.apache.org/jira/browse/SOLR-8583
>             Project: Solr
>          Issue Type: Improvement
>          Components: highlighter
>    Affects Versions: 5.4
>            Reporter: Jan Høydahl
>            Assignee: Jan Høydahl
>             Fix For: 6.1
>
>         Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to