Highlighting in Solr 1.4 - requireFieldMatch
- by Mark Redding
I have an object
Title : foo
Summary : foo bar
Body : this is a published story about a foo and a bar
All three are set up as fields with stored=true.
The user searches across my system for the word
"foo"
I would like to highlight foo in all three places.
The user searches for the word foo in the title
"title:foo"
I only want to highlight foo within the title.
When I added
hl.requireFieldMatch=true and hl.usePhraseHighlighter=true as part of my query over to SOLR I am unable to get the highlighting in all three places when doing a generic non fielded search. Is there a way to get both scenarios to work?
I had these two items turned off, but I am adding in some fielded portions of the query that the user does not see which only display Published items for instance. the problem is
(foo AND status:published)
is causing the word published in the body to highlight when the user only searched for the word "foo".