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) |
public TermVectorsFields(BytesReference headerRef, BytesReference termVectors) throws IOException
headerRef - Stores offsets per field in the termVectors and some
header information as BytesRef.termVectors - Stores the actual term vectors as a BytesRef.IOExceptionpublic org.apache.lucene.index.Terms terms(String field) throws IOException
terms in class org.apache.lucene.index.FieldsIOExceptionpublic int size()
size in class org.apache.lucene.index.FieldsCopyright © 2009–2017. All rights reserved.