AtomicReader is an abstract class, providing an interface for accessing an
index. Search of an index is done entirely through this abstract interface,
so that any subclass which implements it is searchable. IndexReaders implemented
by this subclass do not consist of several sub-readers,
they are atomic. They support retrieval of stored fields, doc values, terms,
and postings.

For efficiency, in this API documents are often referred to via
document numbers, non-negative integers which each name a unique
document in the index. These document numbers are ephemeral -- they may change
as documents are added to and deleted from an index. Clients should thus not
rely on a given document having the same number between sessions.

NOTE: IndexReader instances are completely thread
safe, meaning multiple threads can call any of its methods,
concurrently. If your application requires external
synchronization, you should not synchronize on the
IndexReader instance; use your own
(non-Lucene) objects instead.

Method Detail

getContext

Iff this reader is composed of sub
readers, i.e. this reader being a composite reader, this method returns a
CompositeReaderContext holding the reader's direct children as well as a
view of the reader tree's atomic leaf contexts. All sub-
IndexReaderContext instances referenced from this readers top-level
context are private to this reader and are not shared with another context
tree. For example, IndexSearcher uses this API to drive searching by one
atomic leaf reader at a time. If this reader is not composed of child
readers, this method returns an AtomicReaderContext.

docFreq

Returns the number of documents containing the
term. This method returns 0 if the term or
field does not exists. This method does not take into
account deleted documents that have not yet been merged
away.

totalTermFreq

Returns the number of documents containing the term
t. This method returns 0 if the term or
field does not exists. This method does not take into
account deleted documents that have not yet been merged
away.

getSumDocFreq

Returns the sum of TermsEnum.docFreq() for all terms in this field,
or -1 if this measure isn't stored by the codec. Note that, just like other
term measures, this measure does not take deleted documents into account.

getDocCount

Returns the number of documents that have at least one term for this field,
or -1 if this measure isn't stored by the codec. Note that, just like other
term measures, this measure does not take deleted documents into account.

getSumTotalTermFreq

Returns the sum of TermsEnum.totalTermFreq() for all terms in this
field, or -1 if this measure isn't stored by the codec (or if this fields
omits term freq and positions). Note that, just like other term measures,
this measure does not take deleted documents into account.

getLiveDocs

Returns the Bits representing live (not
deleted) docs. A set bit indicates the doc ID has not
been deleted. If this method returns null it means
there are no deleted documents (all documents are
live).
The returned instance has been safely published for
use by multiple threads without additional
synchronization.