open()
methods, e.g. {@link
/// #Open(String, boolean)}.
/// 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.
/// An IndexReader can be opened on a directory for which an IndexWriter is
/// opened already, but it cannot be used to delete documents from the index then.
///
/// NOTE: for backwards API compatibility, several methods are not listed
/// as abstract, but have no useful implementations in this base class and
/// instead always throw UnsupportedOperationException. Subclasses are
/// strongly encouraged to override these methods, but in many cases may not
/// need to.
///
///
/// NOTE: as of 2.4, it's possible to open a read-only
/// IndexReader using one of the static open methods that
/// accepts the boolean readOnly parameter. Such a reader has
/// better concurrency as it's not necessary to synchronize on
/// the isDeleted method. Currently the default for readOnly
/// is false, meaning if not specified you will get a
/// read/write IndexReader. But in 3.0 this default will
/// change to true, meaning you must explicitly specify false
/// if you want to make changes with the resulting IndexReader.
///
/// NOTE: {@link
/// 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.
/// /// IndexReader reader = ... /// ... /// IndexReader newReader = r.reopen(); /// if (newReader != reader) { /// ... // reader was reopened /// reader.close(); /// } /// reader = newReader; /// ... ////// /// Be sure to synchronize that code so that other threads, /// if present, can never use reader after it has been /// closed and before it's switched to newReader. /// /// NOTE: If this reader is a near real-time /// reader (obtained from {@link IndexWriter#GetReader()}, /// reopen() will simply call writer.getReader() again for /// you, though this may change in the future. /// ///
true
if the index is optimized; false
otherwise
/// true
if an index exists at the specified directory.
/// If the directory does not exist or if there is no index in it.
/// false
is returned.
/// true
if an index exists; false
otherwise
/// true
if an index exists at the specified directory.
/// If the directory does not exist or if there is no index in it.
/// true
if an index exists; false
otherwise
/// true
if an index exists at the specified directory.
/// If the directory does not exist or if there is no index in it.
/// true
if an index exists; false
otherwise
/// n
th
/// Document
in this index.
///
/// NOTE: for performance reasons, this method does not check if the
/// requested document is deleted, and therefore asking for a deleted document
/// may yield unspecified results. Usually this is not required, however you
/// can call {@link #IsDeleted(int)} with the requested document ID to verify
/// the document is not deleted.
///
/// n
/// th position. The {@link FieldSelector} may be used to determine
/// what {@link Lucene.Net.Documents.Field}s to load and how they should
/// be loaded. NOTE: If this Reader (more specifically, the underlying
/// FieldsReader
) is closed before the lazy
/// {@link Lucene.Net.Documents.Field} is loaded an exception may be
/// thrown. If you want the value of a lazy
/// {@link Lucene.Net.Documents.Field} to be available after closing you
/// must explicitly load it or fetch the Document again with a new loader.
///
/// NOTE: for performance reasons, this method does not check if the
/// requested document is deleted, and therefore asking for a deleted document
/// may yield unspecified results. Usually this is not required, however you
/// can call {@link #IsDeleted(int)} with the requested document ID to verify
/// the document is not deleted.
///
/// n
th position
///
/// The {@link FieldSelector} to use to determine what
/// Fields should be loaded on the Document. May be null, in which case
/// all Fields will be loaded.
///
/// write.lock
could not
/// be obtained)
/// write.lock
could not
/// be obtained)
/// t
.term
. For each document, the document number, the frequency of
/// the term in that document is also provided, for use in
/// search scoring. If term is null, then all non-deleted
/// docs are returned with freq=1.
/// Thus, this method implements the mapping:
/// term
. For each document, in addition to the document number
/// and frequency of the term in that document, a list of all of the ordinal
/// positions of the term in the document is available. Thus, this method
/// implements the mapping:
///
/// docNum
. Once a document is
/// deleted it will not appear in TermDocs or TermPostitions enumerations.
/// Attempts to read its field with the {@link #document}
/// method will result in an error. The presence of this document may still be
/// reflected in the {@link #docFreq} statistic, though
/// this will be corrected eventually as the index is further modified.
///
/// write.lock
could not
/// be obtained)
/// docNum
.
/// Applications should call {@link #DeleteDocument(int)} or {@link #DeleteDocuments(Term)}.
/// term
indexed.
/// This is useful if one uses a document field to hold a unique ID string for
/// the document. Then to delete such a document, one merely constructs a
/// term with the appropriate field and the unique ID string as its text and
/// passes it to this method.
/// See {@link #DeleteDocument(int)} for information about when this deletion will
/// become effective.
///
/// write.lock
could not
/// be obtained)
/// write.lock
could not
/// be obtained)
/// true
iff the index in the named directory is
/// currently locked.
/// true
iff the index in the named directory is
/// currently locked.
///