How to use Lucene's Hi开发者_C百科ghlighter 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 queryAll the above needs to be highlighted.
How do I achieve this ?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.
精彩评论