Thanks Mike. This is little bit clear to me now. Just to make sure I got it right, do you mean that we need to store just the offsets and set IndexOptions to DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS to be able to use PostingsHighlighter? Also we don't need to store TermVectors and Positions. Correct?
I believe usecase for storing TermVectors and Positions is to use other highlighter (FastVectorHighlighter) On Wed, May 8, 2013 at 5:59 AM, Michael McCandless < luc...@mikemccandless.com> wrote: > On Wed, May 8, 2013 at 4:23 AM, AarKay <ksu.wildc...@gmail.com> wrote: > > I see that Lucene 4.x has FieldInfo.IndexOptions that can be used to tell > > lucene whether to Index Documents/Frequencies/Positions/Offsets. > > > > We are in the process of upgrading from Lucene 2.9 to Lucene 4.x and I > was > > wondering if there was a way to tell lucene whether to index > > docs/freqs/pos/offsets or not in the older versions (2.9) or did it > always > > index positions and offsets by default? > > I believe in 2.9 you could only say "docs" > (omitTermFreqAndPositions=true), or "docs+freqs+positions". Offsets > are new in 4.x. > > > Also I see that Lucene 4.x has FieldType.setStoreTermVectorPositions and > > FieldType.setStoreTermVectorOffsets. > > Can someone please tell me a usecase for storing positions and offsets in > > index? > > Storing offsets in the index (postings) lets you use the new > PostingsHighlighter. It should be faster than the other two > highlighters which rely on term vectors or on re-analysis at search > time. > > > Is it necessary to store termvector positions and offsets when using > > IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS? > > No. > > Term vectors are stored separately from postings (IndexOptions > controls what's put into the postings). > > Mike McCandless > > http://blog.mikemccandless.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >