Class AtomicReader
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.
Inheritance
System.Object
AtomicReader
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.dll
Syntax
public abstract class AtomicReader : IndexReader, IDisposable
Constructors
|
Improve this Doc
View Source
AtomicReader()
Sole constructor. (For invocation by subclass
constructors, typically implicit.)
Declaration
Properties
|
Improve this Doc
View Source
AtomicContext
LUCENENET specific propety that allows access to
the context as AtomicReaderContext,
which prevents the need to cast.
Declaration
public AtomicReaderContext AtomicContext { get; }
Property Value
|
Improve this Doc
View Source
Context
Declaration
public override sealed IndexReaderContext Context { get; }
Property Value
Overrides
|
Improve this Doc
View Source
FieldInfos
Get the FieldInfos describing all fields in
this reader.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Declaration
public abstract FieldInfos FieldInfos { get; }
Property Value
|
Improve this Doc
View Source
Fields
Returns Fields for this reader.
this property may return null
if the reader has no
postings.
Declaration
public abstract Fields Fields { get; }
Property Value
|
Improve this Doc
View Source
LiveDocs
Returns the IBits 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.
Declaration
public abstract IBits LiveDocs { get; }
Property Value
Methods
|
Improve this Doc
View Source
CheckIntegrity()
Checks consistency of this reader.
Note that this may be costly in terms of I/O, e.g.
may involve computing a checksum value against large data files.
This is a Lucene.NET INTERNAL API, use at your own risk
Declaration
public abstract void CheckIntegrity()
|
Improve this Doc
View Source
DocFreq(Term)
Declaration
public override sealed int DocFreq(Term term)
Parameters
Type |
Name |
Description |
Term |
term |
|
Returns
Type |
Description |
System.Int32 |
|
Overrides
|
Improve this Doc
View Source
GetBinaryDocValues(String)
Returns BinaryDocValues for this field, or
null
if no BinaryDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public abstract BinaryDocValues GetBinaryDocValues(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetDocCount(String)
Declaration
public override sealed int GetDocCount(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.Int32 |
|
Overrides
|
Improve this Doc
View Source
GetDocsWithField(String)
Returns a IBits at the size of reader.MaxDoc
,
with turned on bits for each docid that does have a value for this field,
or null
if no DocValues were indexed for this field. The
returned instance should only be used by a single thread.
Declaration
public abstract IBits GetDocsWithField(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetNormValues(String)
Returns NumericDocValues representing norms
for this field, or null
if no NumericDocValues
were indexed. The returned instance should only be
used by a single thread.
Declaration
public abstract NumericDocValues GetNormValues(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetNumericDocValues(String)
Returns NumericDocValues for this field, or
null if no NumericDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public abstract NumericDocValues GetNumericDocValues(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetSortedDocValues(String)
Returns SortedDocValues for this field, or
null
if no SortedDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public abstract SortedDocValues GetSortedDocValues(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetSortedSetDocValues(String)
Declaration
public abstract SortedSetDocValues GetSortedSetDocValues(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
GetSumDocFreq(String)
Declaration
public override sealed long GetSumDocFreq(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.Int64 |
|
Overrides
|
Improve this Doc
View Source
GetSumTotalTermFreq(String)
Declaration
public override sealed long GetSumTotalTermFreq(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.Int64 |
|
Overrides
|
Improve this Doc
View Source
GetTermDocsEnum(Term)
Returns DocsEnum for the specified term.
This will return null
if either the field or
term does not exist.
Declaration
public DocsEnum GetTermDocsEnum(Term term)
Parameters
Type |
Name |
Description |
Term |
term |
|
Returns
See Also
|
Improve this Doc
View Source
GetTermPositionsEnum(Term)
Returns DocsAndPositionsEnum for the specified
term. This will return null
if the
field or term does not exist or positions weren't indexed.
Declaration
public DocsAndPositionsEnum GetTermPositionsEnum(Term term)
Parameters
Type |
Name |
Description |
Term |
term |
|
Returns
See Also
|
Improve this Doc
View Source
GetTerms(String)
This may return null
if the field does not exist.
Declaration
public Terms GetTerms(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
|
Improve this Doc
View Source
HasNorms(String)
Returns true if there are norms stored for this field
.
Declaration
[Obsolete("(4.0) use FieldInfos and check FieldInfo.HasNorms for the field instead.")]
public bool HasNorms(string field)
Parameters
Type |
Name |
Description |
System.String |
field |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TotalTermFreq(Term)
Returns the number of documents containing the term
.
This method returns 0 if the term or
field does not exist. This method does not take into
account deleted documents that have not yet been merged
away.
Declaration
public override sealed long TotalTermFreq(Term term)
Parameters
Type |
Name |
Description |
Term |
term |
|
Returns
Type |
Description |
System.Int64 |
|
Overrides
Implements
System.IDisposable
Extension Methods