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

Robert Muir commented on LUCENE-5274:
-------------------------------------

Thanks Nik: I can help with that one!

Another question: about the MergedIterator :)

I can see the possible use case here, but I think it deserves some discussion 
first (versus just making it public).
This thing has limitations (its currently only used by indexwriter for 
buffereddeletes, its basically like a MultiTerms over an Iterator). For example 
each iterator it consumes should not have duplicate values according to its 
compareTo(): its not clear to me this WeightedPhraseInfo behaves this way:
* what if you have a synonym of "dog" sitting on top of "cat" with the same 
boost factor... its a duplicate according to that compareTo, but the text is 
different.
* what if the synonym is just "dog" with posinc=0 stacked ontop of itself 
(which is totally valid to do)...

Perhaps highlighting can make use of it, but its unclear to me that its really 
following the contract. Furthermore the class in question (WeightedPhraseInfo) 
is public, and adding Comparable to it looks like it will create a situation 
where its inconsistent with equals()... I think this is a little dangerous.

If it turns out we can reuse it: great! But i think rather than just slapping 
public on it, we should move it to .util, ensure it has good javadocs and unit 
tests, and investigate what exactly happens when these contracts are violated: 
e.g. can we make an exception happen rather than just broken behavior in a way 
that won't hurt performance and so on?



> 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