Package org.apache.lucene.search.suggest
Class SortedTermFreqIteratorWrapper
- java.lang.Object
-
- org.apache.lucene.search.suggest.SortedTermFreqIteratorWrapper
-
- All Implemented Interfaces:
TermFreqIterator
,org.apache.lucene.util.BytesRefIterator
public class SortedTermFreqIteratorWrapper extends Object implements TermFreqIterator
This wrapper buffers incoming elements and makes sure they are sorted based on given comparator.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.search.spell.TermFreqIterator
TermFreqIterator.TermFreqIteratorWrapper
-
-
Constructor Summary
Constructors Constructor Description SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator)
SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator, boolean compareRawBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
decode(org.apache.lucene.util.BytesRef scratch, org.apache.lucene.store.ByteArrayDataInput tmpInput)
protected void
encode(Sort.ByteSequencesWriter writer, org.apache.lucene.store.ByteArrayDataOutput output, byte[] buffer, org.apache.lucene.util.BytesRef spare, long weight)
Comparator<org.apache.lucene.util.BytesRef>
getComparator()
org.apache.lucene.util.BytesRef
next()
long
weight()
-
-
-
Constructor Detail
-
SortedTermFreqIteratorWrapper
public SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator) throws IOException
- Throws:
IOException
-
SortedTermFreqIteratorWrapper
public SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator, boolean compareRawBytes) throws IOException
- Throws:
IOException
-
-
Method Detail
-
next
public org.apache.lucene.util.BytesRef next() throws IOException
- Specified by:
next
in interfaceorg.apache.lucene.util.BytesRefIterator
- Throws:
IOException
-
getComparator
public Comparator<org.apache.lucene.util.BytesRef> getComparator()
- Specified by:
getComparator
in interfaceorg.apache.lucene.util.BytesRefIterator
-
weight
public long weight()
- Specified by:
weight
in interfaceTermFreqIterator
-
encode
protected void encode(Sort.ByteSequencesWriter writer, org.apache.lucene.store.ByteArrayDataOutput output, byte[] buffer, org.apache.lucene.util.BytesRef spare, long weight) throws IOException
- Throws:
IOException
-
decode
protected long decode(org.apache.lucene.util.BytesRef scratch, org.apache.lucene.store.ByteArrayDataInput tmpInput)
-
-