Y, to add to Scott's advice, make sure to use the NullFragmenter and make sure
to setExpandMultiTermQuery to true on your scorer
QueryScorer scorer = new QueryScorer(query, field);
scorer.setExpandMultiTermQuery(true);
If you need to highlight entire phrases, see Koji Sekiguchi's recent
recommendation for the FastVectorHighlighter [0]...although iirc, that might
not handle...this info may be out of date though.
Finally, if you want to go it alone and get into the weeds, consider using [1]
with [2].
Cheers,
Tim
[0]
https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201512.mbox/%3C565E816D.9070306%40rondhuit.com%3E
[1]
https://github.com/tballison/lucene-addons/blob/master/lucene-5317/src/main/java/org/apache/lucene/search/spans/SimpleSpanQueryConverter.java
[2]
https://mail-archives.apache.org/mod_mbox/lucene-java-user/201511.mbox/%3CBY2PR09MB112F5004CD269FA936812DFC72B0%40BY2PR09MB112.namprd09.prod.outlook.com%3E
-----Original Message-----
From: scott cote [mailto:[email protected]]
Sent: Tuesday, December 01, 2015 5:26 PM
To: [email protected]
Subject: Re: Highlighting deprecation?
checkout the highlight package …
https://lucene.apache.org/core/5_3_0/highlighter/org/apache/lucene/search/highlight/package-summary.html
<https://lucene.apache.org/core/5_3_0/highlighter/org/apache/lucene/search/highlight/package-summary.html>
SCott
> On Dec 1, 2015, at 4:16 PM, Kunzman, Douglas * <[email protected]>
> wrote:
>
> Hi -
>
> I would like to thank everyone for their help in understanding Terms in
> Lucene over the weekend.
> After checking the documentation for a day or two I have another quick
> question.
> I'm trying to highlight all of the found terms in the document before
> displaying it and have something working use getTokenStream from the class
> TokenSources.
>
> Unfortunately, in Lucene 5.3.1 everything is deprecated in that class and the
> documentation don't appear to tell you were the "new" and better methods are
> located.
>
> Any ideas/suggestions?
>
> Doug