Class SortingAtomicReader
An Lucene.Net.Index.AtomicReader which supports sorting documents by a given
Lucene.Net.Search.Sort. You can use this class to sort an index as follows:
IndexWriter writer; // writer to which the sorted index will be added
DirectoryReader reader; // reader on the input index
Sort sort; // determines how the documents are sorted
AtomicReader sortingReader = SortingAtomicReader.Wrap(SlowCompositeReaderWrapper.Wrap(reader), sort);
writer.AddIndexes(reader);
reader.Dispose(); // alternatively, you can use a using block
writer.Dispose(); // alternatively, you can use a using block
Note
This API is experimental and might change in incompatible ways in the next release.
Inheritance
IndexReader
AtomicReader
FilterAtomicReader
SortingAtomicReader
Inherited Members
FilterAtomicReader.Unwrap(AtomicReader)
FilterAtomicReader.m_input
FilterAtomicReader.FieldInfos
FilterAtomicReader.NumDocs
FilterAtomicReader.MaxDoc
FilterAtomicReader.DoClose()
FilterAtomicReader.ToString()
FilterAtomicReader.CheckIntegrity()
AtomicReader.Context
AtomicReader.AtomicContext
AtomicReader.DocFreq(Term)
AtomicReader.TotalTermFreq(Term)
AtomicReader.GetTermDocsEnum(Term)
AtomicReader.GetTermPositionsEnum(Term)
IndexReader.AddReaderDisposedListener(IReaderDisposedListener)
IndexReader.RemoveReaderDisposedListener(IReaderDisposedListener)
IndexReader.RegisterParentReader(IndexReader)
IndexReader.RefCount
IndexReader.IncRef()
IndexReader.TryIncRef()
IndexReader.DecRef()
IndexReader.EnsureOpen()
IndexReader.GetHashCode()
IndexReader.Open(Directory)
IndexReader.Open(IndexCommit)
IndexReader.NumDeletedDocs
IndexReader.HasDeletions
IndexReader.Dispose()
IndexReader.Leaves
IndexReader.CoreCacheKey
IndexReader.CombinedCoreAndDeletesKey
Assembly: Lucene.Net.Misc.dll
Syntax
public class SortingAtomicReader : FilterAtomicReader, IDisposable
Properties
Fields
Returns Lucene.Net.Index.Fields for this reader.
this property may return null
if the reader has no
postings.
Declaration
public override Fields Fields { get; }
Property Value
Overrides
Lucene.Net.Index.FilterAtomicReader.Fields
LiveDocs
Returns the Lucene.Net.Util.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 override IBits LiveDocs { get; }
Property Value
Overrides
Lucene.Net.Index.FilterAtomicReader.LiveDocs
Methods
Document(int, StoredFieldVisitor)
Expert: visits the fields of a stored document, for
custom processing/loading of each field. If you
simply want to load all fields, use
Document(int). If you want to load a subset, use
Lucene.Net.Documents.DocumentStoredFieldVisitor.
Declaration
public override void Document(int docID, StoredFieldVisitor visitor)
Parameters
Type |
Name |
Description |
int |
docID |
|
StoredFieldVisitor |
visitor |
|
Overrides
GetBinaryDocValues(string)
Returns Lucene.Net.Index.BinaryDocValues for this field, or
null
if no Lucene.Net.Index.BinaryDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public override BinaryDocValues GetBinaryDocValues(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Type |
Description |
BinaryDocValues |
|
Overrides
GetDocsWithField(string)
Returns a Lucene.Net.Util.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 Lucene.Net.Index.DocValues were indexed for this field. The
returned instance should only be used by a single thread.
Declaration
public override IBits GetDocsWithField(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Overrides
GetNormValues(string)
Returns Lucene.Net.Index.NumericDocValues representing norms
for this field, or null
if no Lucene.Net.Index.NumericDocValues
were indexed. The returned instance should only be
used by a single thread.
Declaration
public override NumericDocValues GetNormValues(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Type |
Description |
NumericDocValues |
|
Overrides
GetNumericDocValues(string)
Returns Lucene.Net.Index.NumericDocValues for this field, or
null if no Lucene.Net.Index.NumericDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public override NumericDocValues GetNumericDocValues(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Type |
Description |
NumericDocValues |
|
Overrides
GetSortedDocValues(string)
Returns Lucene.Net.Index.SortedDocValues for this field, or
null
if no Lucene.Net.Index.SortedDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public override SortedDocValues GetSortedDocValues(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Type |
Description |
SortedDocValues |
|
Overrides
GetSortedSetDocValues(string)
Returns Lucene.Net.Index.SortedSetDocValues for this field, or
null
if no Lucene.Net.Index.SortedSetDocValues were indexed for
this field. The returned instance should only be
used by a single thread.
Declaration
public override SortedSetDocValues GetSortedSetDocValues(string field)
Parameters
Type |
Name |
Description |
string |
field |
|
Returns
Type |
Description |
SortedSetDocValues |
|
Overrides
GetTermVectors(int)
Retrieve term vectors for this document, or null
if
term vectors were not indexed. The returned Lucene.Net.Index.Fields
instance acts like a single-document inverted index
(the docID will be 0).
Declaration
public override Fields GetTermVectors(int docID)
Parameters
Type |
Name |
Description |
int |
docID |
|
Returns
Overrides
Wrap(AtomicReader, Sort)
Return a sorted view of reader
according to the order
defined by sort
. If the reader is already sorted, this
method might return the reader as-is.
Declaration
public static AtomicReader Wrap(AtomicReader reader, Sort sort)
Parameters
Type |
Name |
Description |
AtomicReader |
reader |
|
Sort |
sort |
|
Returns
Type |
Description |
AtomicReader |
|
Implements