Class UniformSplitTermsReader
- java.lang.Object
-
- org.apache.lucene.index.Fields
-
- org.apache.lucene.codecs.FieldsProducer
-
- org.apache.lucene.codecs.uniformsplit.UniformSplitTermsReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<String>
,Accountable
- Direct Known Subclasses:
STUniformSplitTermsReader
public class UniformSplitTermsReader extends FieldsProducer
A block-based terms index and dictionary based on the Uniform Split technique.- See Also:
UniformSplitTermsWriter
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexInput
blockInput
protected IndexInput
dictionaryInput
protected Map<String,UniformSplitTerms>
fieldToTermsMap
protected PostingsReaderBase
postingsReader
protected Collection<String>
sortedFieldNames
protected static int
VERSION_START
-
Fields inherited from class org.apache.lucene.index.Fields
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Modifier Constructor Description UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder)
protected
UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, FieldMetadata.Serializer fieldMetadataReader, String codecName, int versionStart, int versionCurrent, String termsBlocksExtension, String dictionaryExtension)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkIntegrity()
void
close()
protected void
fillFieldMap(PostingsReaderBase postingsReader, BlockDecoder blockDecoder, IndexInput dictionaryInput, IndexInput blockInput, Collection<FieldMetadata> fieldMetadataCollection, FieldInfos fieldInfos)
protected long
getTermsRamBytesUsed()
Iterator<String>
iterator()
protected static Collection<FieldMetadata>
parseFieldsMetadata(IndexInput indexInput, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs)
long
ramBytesUsed()
protected static void
seekFieldsMetadata(IndexInput indexInput)
Positions the givenIndexInput
at the beginning of the fields metadata.int
size()
Terms
terms(String field)
-
Methods inherited from class org.apache.lucene.codecs.FieldsProducer
getMergeInstance
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
VERSION_START
protected static final int VERSION_START
- See Also:
- Constant Field Values
-
postingsReader
protected final PostingsReaderBase postingsReader
-
blockInput
protected final IndexInput blockInput
-
dictionaryInput
protected final IndexInput dictionaryInput
-
fieldToTermsMap
protected final Map<String,UniformSplitTerms> fieldToTermsMap
-
sortedFieldNames
protected final Collection<String> sortedFieldNames
-
-
Constructor Detail
-
UniformSplitTermsReader
public UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder) throws IOException
- Parameters:
blockDecoder
- Optional block decoder, may be null if none. It can be used for decompression or decryption.- Throws:
IOException
-
UniformSplitTermsReader
protected UniformSplitTermsReader(PostingsReaderBase postingsReader, SegmentReadState state, BlockDecoder blockDecoder, FieldMetadata.Serializer fieldMetadataReader, String codecName, int versionStart, int versionCurrent, String termsBlocksExtension, String dictionaryExtension) throws IOException
- Parameters:
blockDecoder
- Optional block decoder, may be null if none. It can be used for decompression or decryption.- Throws:
IOException
-
-
Method Detail
-
fillFieldMap
protected void fillFieldMap(PostingsReaderBase postingsReader, BlockDecoder blockDecoder, IndexInput dictionaryInput, IndexInput blockInput, Collection<FieldMetadata> fieldMetadataCollection, FieldInfos fieldInfos) throws IOException
- Throws:
IOException
-
parseFieldsMetadata
protected static Collection<FieldMetadata> parseFieldsMetadata(IndexInput indexInput, FieldInfos fieldInfos, FieldMetadata.Serializer fieldMetadataReader, int maxNumDocs) throws IOException
- Parameters:
indexInput
-IndexInput
must be positioned to the fields metadata details by callingseekFieldsMetadata(IndexInput)
before this call.- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classFieldsProducer
- Throws:
IOException
-
checkIntegrity
public void checkIntegrity() throws IOException
- Specified by:
checkIntegrity
in classFieldsProducer
- Throws:
IOException
-
ramBytesUsed
public long ramBytesUsed()
-
getTermsRamBytesUsed
protected long getTermsRamBytesUsed()
-
seekFieldsMetadata
protected static void seekFieldsMetadata(IndexInput indexInput) throws IOException
Positions the givenIndexInput
at the beginning of the fields metadata.- Throws:
IOException
-
-