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

Adrien Grand commented on LUCENE-5274:
--------------------------------------

I had a problem when applying the patch (it removed MergedIterator.java) but 
overall the patch looks good to me. There are some things that might be worth 
checking before committing:
 - even though these are tests, the definition for the 'field_der_red' analyzer 
in matchedFieldsTestCase looks weird since it declares being an analyzer 
wrapper but doesn't reuse the underlying analyzer, maybe it should use an 
anonymous Field impl that would override the tokenStream() method to return a 
CannedTokenStream instead of defining an analyzer?
 - the documentation and some method names still refer to child fields, I think 
that 'matched' fields, that you used in the FVH javadoc, is a better 
description?
 - I think the {{matchedFields}} argument of getBestFragments should be a 
Set<String> instead of an array to ensure uniqueness
 - maybe the {{assert fieldNames.length > 0;}} in FVH.getFieldFragList should 
be replaced by a hard check since it is checking user-provided data?
 - You added WeightedPhraseInfo.merge which mutates in place although the class 
seems to have been designed to be immutable (it computes the value of 'text' in 
the constructor based on termInfos, and you update termInfos in merge, so this 
seems to invalidate the value of 'text'?)

> Teach fast FastVectorHighlighter to highlight "child fields" with parent 
> fields
> -------------------------------------------------------------------------------
>
>                 Key: LUCENE-5274
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5274
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/other
>            Reporter: Nik Everett
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-5274.patch
>
>
> I've been messing around with the FastVectorHighlighter and it looks like I 
> can teach it to highlight matches on "child fields".  Like this query:
> foo:scissors foo_exact:running
> would highlight foo like this:
> <em>running</em> with <em>scissors</em>
> Where foo is stored WITH_POSITIONS_OFFSETS and foo_plain is an unstored copy 
> of foo a different analyzer and its own WITH_POSITIONS_OFFSETS.
> This would make queries that perform weighted matches against different 
> analyzers much more convenient to highlight.
> I have working code and test cases but they are hacked into Elasticsearch.  
> I'd love to Lucene-ify if you'll take them.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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

Reply via email to