public class SortingLeafReader extends FilterLeafReader
LeafReader which supports sorting documents by a given
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 LeafReader sortingReader = SortingLeafReader.wrap(SlowCompositeReaderWrapper.wrap(reader), sort); writer.addIndexes(reader); writer.close(); reader.close();
FilterLeafReader.FilterFields, FilterLeafReader.FilterPostingsEnum, FilterLeafReader.FilterTerms, FilterLeafReader.FilterTermsEnumLeafReader.CoreClosedListenerIndexReader.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) |
SortedNumericDocValues |
getSortedNumericDocValues(String field) |
SortedSetDocValues |
getSortedSetDocValues(String field) |
Fields |
getTermVectors(int docID) |
String |
toString() |
static LeafReader |
wrap(LeafReader reader,
Sort sort)
Return a sorted view of
reader according to the order
defined by sort. |
addCoreClosedListener, checkIntegrity, doClose, getDelegate, getFieldInfos, maxDoc, numDocs, removeCoreClosedListener, unwrapaddCoreClosedListenerAsReaderClosedListener, docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, removeCoreClosedListenerAsReaderClosedListener, termDocsEnum, termPositionsEnum, terms, totalTermFreqaddReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getCombinedCoreAndDeletesKey, getCoreCacheKey, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, removeReaderClosedListener, tryIncRefpublic static LeafReader wrap(LeafReader reader, Sort sort) throws IOException
reader according to the order
defined by sort. If the reader is already sorted, this
method might return the reader as-is.IOExceptionpublic void document(int docID,
StoredFieldVisitor visitor)
throws IOException
document in class FilterLeafReaderIOExceptionpublic Fields fields() throws IOException
fields in class FilterLeafReaderIOExceptionpublic BinaryDocValues getBinaryDocValues(String field) throws IOException
getBinaryDocValues in class FilterLeafReaderIOExceptionpublic Bits getLiveDocs()
getLiveDocs in class FilterLeafReaderpublic NumericDocValues getNormValues(String field) throws IOException
getNormValues in class FilterLeafReaderIOExceptionpublic NumericDocValues getNumericDocValues(String field) throws IOException
getNumericDocValues in class FilterLeafReaderIOExceptionpublic SortedNumericDocValues getSortedNumericDocValues(String field) throws IOException
getSortedNumericDocValues in class FilterLeafReaderIOExceptionpublic SortedDocValues getSortedDocValues(String field) throws IOException
getSortedDocValues in class FilterLeafReaderIOExceptionpublic SortedSetDocValues getSortedSetDocValues(String field) throws IOException
getSortedSetDocValues in class FilterLeafReaderIOExceptionpublic Bits getDocsWithField(String field) throws IOException
getDocsWithField in class FilterLeafReaderIOExceptionpublic Fields getTermVectors(int docID) throws IOException
getTermVectors in class FilterLeafReaderIOExceptionpublic String toString()
toString in class FilterLeafReaderCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.