4

What is the best way to extract term positions from the Lucene search result?

I'm using Lucene 4.0 with custom analyser and trying to locate each occurrence of given term in each document.

One option is to use code from highlight module of Lucene. I also found question: Finding the position of search hits from Lucene but solution applies only to previous version of Lucene.

Are there any other possibilities different than highlighter in Lucene 4?

Community
  • 1
  • 1
d3m0n
  • 366
  • 1
  • 3
  • 15
  • I posted a solution for lucene 5.2.1 here: http://stackoverflow.com/questions/1311199/finding-the-position-of-search-hits-from-lucene/39185606#39185606 – matthiasboesinger Aug 27 '16 at 20:48

1 Answers1

0

Lucene Migration guide is pretty good at helping you change any code from older version of Lucene to newer.

Rishi Dua
  • 2,296
  • 2
  • 24
  • 35