In my understanding in Lucene while creating a Field
we can specify and IndexableFieldType
. FieldType
is the concrete implementation of IndexableFieldType
. Using FieldType
we can control among other things:
- Index Options: These help us control whether we want the field to be searchable or not. Plus we also use the enum
IndexOptions
with values like DOCS, DOCS_AND_FREQUENCIES, DOCS_AND_FREQS_AND_POSITIONS and DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS to control the information we want to store in postings. - Term Vectors: We Also have option to store term vectors. Along with term vectors also, we can store postitions, offsets and payloads.
My question is that if we are already storing offsets positions with IndexOptions, then why do we need to store this in term vector again. I think I don't really understand what term vectors are for. Any explanation on the need for term vectors and what they are exactly will also be helpful. There is no clear explanation available on web.