public final class TermVectorsFields
extends org.apache.lucene.index.Fields
TermVectorsRequest
. It works
exactly like the Fields
class except for one thing: It can return
offsets and payloads even if positions are not present. You must call
nextPosition() anyway to move the counter although this method only returns
-1,, if no positions were returned by the TermVectorsRequest
.
The data is stored in two byte arrays (headerRef
and
termVectors
, both BytesRef
) that have the following format:
headerRef
: Stores offsets per field in the termVectors
array
and some header information as BytesRef
. Format is
termVectors
for field 1termVectors
for last field
termVectors: Stores the actual term vectors as a BytesRef
.
Term vectors for each fields are stored in blocks, one for each field. The
offsets in headerRef
are used to find where the block for a field
starts. Each block begins with a
hasFieldStatistics
is true,
see headerRef
), the following numbers are stored:
After that, for each term it stores
If term statistics are requested (hasTermStatistics
is true, see
headerRef
):
Modifier and Type | Field and Description |
---|---|
boolean |
hasScores |
Constructor and Description |
---|
TermVectorsFields(BytesReference headerRef,
BytesReference termVectors) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<java.lang.String> |
iterator() |
int |
size() |
org.apache.lucene.index.Terms |
terms(java.lang.String field) |
public TermVectorsFields(BytesReference headerRef, BytesReference termVectors) throws java.io.IOException
headerRef
- Stores offsets per field in the termVectors
and some
header information as BytesRef
.termVectors
- Stores the actual term vectors as a BytesRef
.java.io.IOException
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
iterator
in class org.apache.lucene.index.Fields
public org.apache.lucene.index.Terms terms(java.lang.String field) throws java.io.IOException
terms
in class org.apache.lucene.index.Fields
java.io.IOException
public int size()
size
in class org.apache.lucene.index.Fields