1

So I want to use the Lucene Highlighter, and I came across this example:

http://www.programcreek.com/java-api-examples/index.php?api=org.apache.lucene.search.highlight.Highlighter

The problem is, I'm using a newer version of Lucene which doesn't seem to have the QueryScorer class, and other things. I'm using Lucenenet 4.8.0.0 as shown here. So I'm wondering how I can do this in this version of Lucene.

user3685285
  • 6,066
  • 13
  • 54
  • 95
  • Lucene 4.8 still has [QueryScorer](https://lucene.apache.org/core/4_8_0/highlighter/org/apache/lucene/search/highlight/QueryScorer.html). – femtoRgon Apr 12 '17 at 15:49
  • I specifically told you what version of Lucene I was using and even linked to it. I couldn't find it. If you can find it in there, please tell me. – user3685285 Apr 12 '17 at 16:00
  • Given that Lucene.net 4.8 Beta is rather lacking in documentation, I linked to the standard Lucene docs for the version it is meant to be equivalent to. It's in the same place as Highlighter, [contrib/Highlighter](https://github.com/apache/lucenenet/tree/master/src/contrib/Highlighter). – femtoRgon Apr 12 '17 at 18:39
  • I downloaded the source code for this beta. It's not there. You should point out in the Lucenet source code what I missed, or you should redact your downvote. – user3685285 Apr 12 '17 at 18:57
  • I've provided the documentation of it for the java libs it is directly based on, and provided a link directly to it in the repo. I'm frankly not sure what more I can do to lead you to it. – femtoRgon Apr 12 '17 at 19:11
  • Well my guess is that the versions have diverged unless you can show me otherwise. In that case, you shouldn't have downvoted me because I specifically asked about Lucenenet. If you couldn't help me, at least let others who know more help by not making this question appear flawed. – user3685285 Apr 12 '17 at 19:17
  • I linked right to it in the Lucene.Net github repo's master branch, as requested. [It's right here!](https://github.com/apache/lucenenet/blob/master/src/contrib/Highlighter/QueryScorer.cs) – femtoRgon Apr 12 '17 at 19:22
  • I'm asking for the new way to do this because this is supposed to be deprecated and isn't in the normal build, and doesn't work, hence why I can't find it in my source code. Read the readme: https://github.com/apache/lucenenet/tree/master/src/contrib – user3685285 Apr 12 '17 at 19:59
  • Originally Highlighter was included in a separate nuget package named [Lucene.Net.Contrib](https://www.nuget.org/packages/Lucene.Net.Contrib/3.0.3). Currenly I cannot see latest version of this package corresponding to lucene.net 4.8, it still has version 3.0.3. But I can see [Highlighter.cs](https://github.com/apache/lucenenet/blob/master/src/Lucene.Net.Highlighter/Highlight/Highlighter.cs) in latest sources – AndrewSilver May 31 '17 at 14:13
  • I have figured that out finally. You need to install nuget package [Lucene.Net.Highlighter](https://www.nuget.org/packages/Lucene.Net.Highlighter). It is still in beta. – AndrewSilver Jun 05 '17 at 08:01

0 Answers0