3

Lucene allow you to index terms with position and offsets, but even without it is possible to use phrase search. So how lucene can calculate word order in index without this information?

yura
  • 14,489
  • 21
  • 77
  • 126

1 Answers1

1

Perhaps you are confusing termvectors positions/offsets with the inverted index.

Termvectors are not used for searching.

To exclude proximity information in the actual postings lists: use IndexOptions.DOCS_ONLY or IndexOptions.DOCS_AND_FREQS. If you do this, PhraseQueries won't work.

But if you are willing to accept some inaccuracies, these settings can be useful in combination with word-ngram (shinglefilters), for a fast phrase "approximation"..., and of course they are useful for fields where proximity just isn't applicable: such as numeric fields, unique ID fields, etc.

Robert Muir
  • 3,185
  • 21
  • 17