[ 
https://issues.apache.org/jira/browse/LUCENE-7903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley updated LUCENE-7903:
---------------------------------
    Priority: Minor  (was: Major)
     Summary: Highlighting boolean queries shouldn't always highlight some 
clauses  (was: Highlighting does not work as expected)

I've retitled this issue and moved it to Lucene.  It's debatable if this is a 
bug vs improvement but I classified as minor well.  This is a long-standing 
known issue that affects the original Highlighter as well as the 
UnifiedHighlighter.  It probably affects the FVH too but I'm not sure.  I think 
there may be a previous issue on this matter but I'm having difficulty finding 
it so maybe not.

This is a hard problem that requires re-engineering a large and complicated 
part of the UnifiedHighlighter (PhraseHelper) -- and one already on my mind but 
I have no time for right now.  For inspiration, we can look at the highlighter 
in Luwak which decomposes the query tree into separate SpanScorers.  It doesn't 
suffer from this problem and from some related problems to the current approach 
that are already filed in other issues.

> Highlighting boolean queries shouldn't always highlight some clauses
> --------------------------------------------------------------------
>
>                 Key: LUCENE-7903
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7903
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/highlighter
>            Reporter: Damian Pawski
>            Priority: Minor
>
> I am having difficulties with getting correct "highlighting" section from 
> Solr.
> My query returns correct results, only highlighting does not work as I would 
> expected.
> My query:
> http://solrServer/solr/solrCore/select?q=(((field1:((word1)AND(word2)))%20OR%20(field2:((word1)AND(word2)))%20OR%20(field3:((word1)AND(word2)))%20OR%20(field4:((word1)AND(word2)))))&fq=field5:(xxxx)&hl=true&hl.q=field1:(word1)&hl.fl=field1,field2,field3,field4
> If I run this query the highlighting section is correct - there is no 
> document with phrase "word1" - therefore field1 is not listed in the 
> highlighting element - correct.
> If I update my query to:
> http://solrServer/solr/solrCore/select?q=(((field1:((word1)AND(word2)))%20OR%20(field2:((word1)AND(word2)))%20OR%20(field3:((word1)AND(word2)))%20OR%20(field4:((word1)AND(word2)))))&fq=field5:(xxxx)&hl=true&hl.q=field1:(word1
>  OR word2)&hl.fl=field1,field2,field3,field4
> then I am not getting expected results, word2 has been found in field1 but 
> word1 is missing, but Solr returned field1 in highlighting element with 
> highlighted "word2" only.
> I have explicitly added an extra query using hl.q and I have used AND 
> operator (word1 AND word2), why Solr returns field1 in case when only word2 
> has been found?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to