This class contains useful constants representing filenames and extensions
used by lucene, as well as convenience methods for querying whether a file
name matches an extension (matchesExtension), as well as generating file names from a segment name,
generation and extension (
fileNameFromGeneration,
segmentFileName).

If DirectoryReader.open(IndexWriter,boolean) has
been called (ie, this writer is in near real-time
mode), then after a merge completes, this class can be
invoked to warm the reader on the newly merged
segment, before the merge commits.

Positions

DocsAndPositionsEnum is an extension of
DocsEnum that additionally allows iteration
of the positions a term occurred within the document, and any additional
per-position information (offsets and payload)

Index Statistics

Term statistics

TermsEnum.docFreq(): Returns the number of
documents that contain at least one occurrence of the term. This statistic
is always available for an indexed term. Note that it will also count
deleted documents, when segments are merged the statistic is updated as
those deleted documents are merged away.

TermsEnum.totalTermFreq(): Returns the number
of occurrences of this term across all documents. Note that this statistic
is unavailable (returns -1) if term frequencies were omitted
from the index
(DOCS_ONLY)
for the field. Like docFreq(), it will also count occurrences that appear in
deleted documents.

Field statistics

Terms.size(): Returns the number of
unique terms in the field. This statistic may be unavailable
(returns -1) for some Terms implementations such as
MultiTerms, where it cannot be efficiently
computed. Note that this count also includes terms that appear only
in deleted documents: when segments are merged such terms are also merged
away and the statistic is then updated.

Terms.getDocCount(): Returns the number of
documents that contain at least one occurrence of any term for this field.
This can be thought of as a Field-level docFreq(). Like docFreq() it will
also count deleted documents.

Terms.getSumDocFreq(): Returns the number of
postings (term-document mappings in the inverted index) for the field. This
can be thought of as the sum of TermsEnum.docFreq()
across all terms in the field, and like docFreq() it will also count postings
that appear in deleted documents.

Terms.getSumTotalTermFreq(): Returns the number
of tokens for the field. This can be thought of as the sum of
TermsEnum.totalTermFreq() across all terms in the
field, and like totalTermFreq() it will also count occurrences that appear in
deleted documents, and will be unavailable (returns -1) if term
frequencies were omitted from the index
(DOCS_ONLY)
for the field.

FieldInvertState.getNumOverlap(): Returns the number
of tokens for this field in the document that had a position increment of zero. This
can be used to compute a document length that discounts artificial tokens
such as synonyms.