private static final class DirectPostingsFormat.DirectField extends Terms implements Accountable
| Modifier and Type | Class and Description |
|---|---|
private class |
DirectPostingsFormat.DirectField.DirectIntersectTermsEnum |
private class |
DirectPostingsFormat.DirectField.DirectTermsEnum |
private static class |
DirectPostingsFormat.DirectField.HighFreqTerm |
private static class |
DirectPostingsFormat.DirectField.IntArrayWriter |
private static class |
DirectPostingsFormat.DirectField.LowFreqTerm |
private static class |
DirectPostingsFormat.DirectField.TermAndSkip |
| Modifier and Type | Field and Description |
|---|---|
private static long |
BASE_RAM_BYTES_USED |
private int |
count |
private int |
docCount |
private boolean |
hasFreq |
private boolean |
hasOffsets |
private boolean |
hasPayloads |
private boolean |
hasPos |
private int |
minSkipCount |
private int[] |
sameCounts |
private int |
skipCount |
private int[] |
skipOffsets |
private int[] |
skips |
private long |
sumDocFreq |
private long |
sumTotalTermFreq |
private byte[] |
termBytes |
private int[] |
termOffsets |
private DirectPostingsFormat.DirectField.TermAndSkip[] |
terms |
EMPTY_ARRAY| Constructor and Description |
|---|
DirectField(SegmentReadState state,
java.lang.String field,
Terms termsIn,
int minSkipCount,
int lowFreqCutoff) |
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
compare(int ord,
BytesRef other) |
private void |
finishSkips() |
int |
getDocCount()
Returns the number of documents that have at least one
term for this field.
|
long |
getSumDocFreq()
Returns the sum of
TermsEnum.docFreq() for
all terms in this field. |
long |
getSumTotalTermFreq()
Returns the sum of
TermsEnum.totalTermFreq() for
all terms in this field. |
boolean |
hasFreqs()
Returns true if documents in this field store
per-document term frequency (
PostingsEnum.freq()). |
boolean |
hasOffsets()
Returns true if documents in this field store offsets.
|
boolean |
hasPayloads()
Returns true if documents in this field store payloads.
|
boolean |
hasPositions()
Returns true if documents in this field store positions.
|
TermsEnum |
intersect(CompiledAutomaton compiled,
BytesRef startTerm)
Returns a TermsEnum that iterates over all terms and
documents that are accepted by the provided
CompiledAutomaton. |
TermsEnum |
iterator()
Returns an iterator that will step through all
terms.
|
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
private void |
saveSkip(int ord,
int backCount) |
private void |
setSkips(int termOrd,
byte[] termBytes) |
long |
size()
Returns the number of terms for this field, or -1 if this
measure isn't stored by the codec.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildResourcesprivate static final long BASE_RAM_BYTES_USED
private final byte[] termBytes
private final int[] termOffsets
private final int[] skips
private final int[] skipOffsets
private final DirectPostingsFormat.DirectField.TermAndSkip[] terms
private final boolean hasFreq
private final boolean hasPos
private final boolean hasOffsets
private final boolean hasPayloads
private final long sumTotalTermFreq
private final int docCount
private final long sumDocFreq
private int skipCount
private int count
private int[] sameCounts
private final int minSkipCount
public DirectField(SegmentReadState state, java.lang.String field, Terms termsIn, int minSkipCount, int lowFreqCutoff) throws java.io.IOException
java.io.IOExceptionpublic long ramBytesUsed()
AccountableramBytesUsed in interface Accountablepublic java.lang.String toString()
toString in class java.lang.Objectint compare(int ord,
BytesRef other)
private void setSkips(int termOrd,
byte[] termBytes)
private void finishSkips()
private void saveSkip(int ord,
int backCount)
public TermsEnum iterator()
Termspublic TermsEnum intersect(CompiledAutomaton compiled, BytesRef startTerm)
TermsCompiledAutomaton. If the startTerm is
provided then the returned enum will only return terms
> startTerm, but you still must call
next() first to get to the first term. Note that the
provided startTerm must be accepted by
the automaton.
This is an expert low-level API and will only work
for NORMAL compiled automata. To handle any
compiled automata you should instead use
CompiledAutomaton.getTermsEnum(org.apache.lucene.index.Terms) instead.
NOTE: the returned TermsEnum cannot seek
.public long size()
Termspublic long getSumTotalTermFreq()
TermsTermsEnum.totalTermFreq() for
all terms in this field. Note that, just like other term
measures, this measure does not take deleted documents
into account.getSumTotalTermFreq in class Termspublic long getSumDocFreq()
TermsTermsEnum.docFreq() for
all terms in this field. Note that, just like other term
measures, this measure does not take deleted documents
into account.getSumDocFreq in class Termspublic int getDocCount()
TermsgetDocCount in class Termspublic boolean hasFreqs()
TermsPostingsEnum.freq()).public boolean hasOffsets()
TermshasOffsets in class Termspublic boolean hasPositions()
TermshasPositions in class Termspublic boolean hasPayloads()
TermshasPayloads in class Terms