1
votes

How to use Lucene's Highlighter with phraseQuery ?
I did a google search, and I am getting confused with spanScorer, QueryScorer, and few things like that..

The Lucene version I am using is 3.0.3

My requirements are
- Doing a multi field query
- Doing a wildcard search
- Doing a phrase query

All the above needs to be highlighted.
How do I achieve this ?

1
any progress in this? I know, so much time took since you asked this. the link you have above answer is deadKerem
@KeremCan did you try QueryScorer setting I mentioned in the answer? I have forgotten what was I doing here, been 7 years!Shrinath

1 Answers

3
votes

So I found the answer to my own question... After a LOT of hair pulling and google searching, I found this :

http://www.gossamer-threads.com/lists/lucene/java-...g=highlight%20wildcard;#116172

Specifically setting up the QueryScorer with this :

qs.setExpandMultiTermQuery(true);

did the job of highlighting wildcard searches.

As for the multi field stuff, I did ask it to highlight looping through my array of fields. So that was ugly, but works.

Phrase query words with QueryScorer easily.