Does the Lucene index keep track of where in the original document it found each term's occurrence ?
For example: Lucene is indexing a file, and one of the terms found was "banana", and "banana" occurred in the file 3 times. Does Lucene save in the index where it found each occurrence of "banana" ? So for example, I could go to the file's offset of position 100 and find "banana". For that matter, does Lucene know that it was found three times, or just that it was found ?
The reason I ask is that when a user searches for something, I might like to just display snippets of the original file where the term was found, instead of the whole thing, because some of the files are quite large.
For example: Lucene is indexing a file, and one of the terms found was "banana", and "banana" occurred in the file 3 times. Does Lucene save in the index where it found each occurrence of "banana" ? So for example, I could go to the file's offset of position 100 and find "banana". For that matter, does Lucene know that it was found three times, or just that it was found ?
The reason I ask is that when a user searches for something, I might like to just display snippets of the original file where the term was found, instead of the whole thing, because some of the files are quite large.