lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS vs storing positions and offsets/
Date Wed, 08 May 2013 10:59:18 GMT
On Wed, May 8, 2013 at 4:23 AM, AarKay <> 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

> Is it necessary to store termvector positions and offsets when using


Term vectors are stored separately from postings (IndexOptions
controls what's put into the postings).

Mike McCandless

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message