Package org.apache.lucene.index
Class MultiDocValues.OrdinalMap
java.lang.Object
org.apache.lucene.index.MultiDocValues.OrdinalMap
- Enclosing class:
- MultiDocValues
maps per-segment ordinals to/from global ordinal space
-
Constructor Summary
ConstructorsConstructorDescriptionOrdinalMap
(Object owner, TermsEnum[] subs) Creates an ordinal map that allows mapping ords to/from a merged space fromsubs
. -
Method Summary
Modifier and TypeMethodDescriptionint
getFirstSegmentNumber
(long globalOrd) Given a global ordinal, returns the index of the first segment that contains this term.long
getFirstSegmentOrd
(long globalOrd) Given global ordinal, returns the ordinal of the first segment which contains this ordinal (the corresponding to the segment returngetFirstSegmentNumber(long)
).long
getGlobalOrd
(int segmentIndex, long segmentOrd) Given a segment number and segment ordinal, returns the corresponding global ordinal.long
Returns the total number of unique terms in global ord space.long
Returns total byte size used by this ordinal map.
-
Constructor Details
-
OrdinalMap
Creates an ordinal map that allows mapping ords to/from a merged space fromsubs
.- Parameters:
owner
- a cache keysubs
- TermsEnums that supportTermsEnum.ord()
. They need not be dense (e.g. can be FilteredTermsEnums}.- Throws:
IOException
- if an I/O error occurred.
-
-
Method Details
-
getGlobalOrd
public long getGlobalOrd(int segmentIndex, long segmentOrd) Given a segment number and segment ordinal, returns the corresponding global ordinal. -
getFirstSegmentOrd
public long getFirstSegmentOrd(long globalOrd) Given global ordinal, returns the ordinal of the first segment which contains this ordinal (the corresponding to the segment returngetFirstSegmentNumber(long)
). -
getFirstSegmentNumber
public int getFirstSegmentNumber(long globalOrd) Given a global ordinal, returns the index of the first segment that contains this term. -
getValueCount
public long getValueCount()Returns the total number of unique terms in global ord space. -
ramBytesUsed
public long ramBytesUsed()Returns total byte size used by this ordinal map.
-