You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Michał Słomkowski <mi...@breitenbachmedia.com> on 2015/10/22 18:30:36 UTC

Highlighting queries in parentheses

Hello,

recently I've deployed Solr 5.2.1 and I've observed the following issue:

My documents have two fields: id and text. Solr is configured to use 
FastVectorHighlighter (I've tried StandardHighlighter too, no 
difference). I've created the schema.xml, solrconfig.xml hasn't been 
changed in any way.

I have a following highlighting query: text:((foo AND bar) OR eggs). 
Let's say the documents contains only bar and eggs. Currently both of 
them are highlighted. However the desired behaviour is to highlight eggs 
only since (foo AND bar) is not true.

The query I send has following parameters:

         'fl': 'id',
         'hl': 'true',
         'hl.requireFieldMatch': 'true',
         'hl.fragListBuilder': 'single',
         'hl.fragsize': '0',
         'hl.fl': 'text',
         'hl.mergeContiguous': 'true',
         'hl.useFastVectorHighlighter': 'true',
         'hl.q': 'text:((foo AND bar) OR eggs)'

I'd like to know what should I do to make it work as expected.