public class SortingAtomicReader extends FilterAtomicReader
AtomicReader which supports sorting documents by a given
Sorter. 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 Sorter sorter; // determines how the documents are sorted AtomicReader sortingReader = SortingAtomicReader.wrap(SlowCompositeReaderWrapper.wrap(reader), sorter); writer.addIndexes(reader); writer.close(); reader.close();
FilterAtomicReader.FilterDocsAndPositionsEnum, FilterAtomicReader.FilterDocsEnum, FilterAtomicReader.FilterFields, FilterAtomicReader.FilterTerms, FilterAtomicReader.FilterTermsEnumIndexReader.ReaderClosedListenerin| Modifier and Type | Method and Description |
|---|---|
void |
document(int docID,
StoredFieldVisitor visitor) |
Fields |
fields() |
BinaryDocValues |
getBinaryDocValues(String field) |
Bits |
getDocsWithField(String field) |
Bits |
getLiveDocs() |
NumericDocValues |
getNormValues(String field) |
NumericDocValues |
getNumericDocValues(String field) |
SortedDocValues |
getSortedDocValues(String field) |
SortedSetDocValues |
getSortedSetDocValues(String field) |
Fields |
getTermVectors(int docID) |
static AtomicReader |
wrap(AtomicReader reader,
Sorter.DocMap docMap)
Expert: same as
wrap(AtomicReader, Sorter) but operates directly on a Sorter.DocMap. |
static AtomicReader |
wrap(AtomicReader reader,
Sorter sorter)
Return a sorted view of
reader according to the order
defined by sorter. |
doClose, getFieldInfos, maxDoc, numDocs, toStringdocFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, hasNorms, termDocsEnum, termPositionsEnum, terms, totalTermFreqaddReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getCombinedCoreAndDeletesKey, getCoreCacheKey, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, open, open, open, open, open, registerParentReader, removeReaderClosedListener, tryIncRefpublic static AtomicReader wrap(AtomicReader reader, Sorter sorter) throws IOException
reader according to the order
defined by sorter. If the reader is already sorted, this
method might return the reader as-is.IOExceptionpublic static AtomicReader wrap(AtomicReader reader, Sorter.DocMap docMap)
wrap(AtomicReader, Sorter) but operates directly on a Sorter.DocMap.public void document(int docID,
StoredFieldVisitor visitor)
throws IOException
document in class FilterAtomicReaderIOExceptionpublic Fields fields() throws IOException
fields in class FilterAtomicReaderIOExceptionpublic BinaryDocValues getBinaryDocValues(String field) throws IOException
getBinaryDocValues in class FilterAtomicReaderIOExceptionpublic Bits getLiveDocs()
getLiveDocs in class FilterAtomicReaderpublic NumericDocValues getNormValues(String field) throws IOException
getNormValues in class FilterAtomicReaderIOExceptionpublic NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues in class FilterAtomicReaderIOExceptionpublic SortedDocValues getSortedDocValues(String field) throws IOException
getSortedDocValues in class FilterAtomicReaderIOExceptionpublic SortedSetDocValues getSortedSetDocValues(String field) throws IOException
getSortedSetDocValues in class FilterAtomicReaderIOExceptionpublic Bits getDocsWithField(String field) throws IOException
getDocsWithField in class FilterAtomicReaderIOExceptionpublic Fields getTermVectors(int docID) throws IOException
getTermVectors in class FilterAtomicReaderIOExceptionCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.