public class FastHit extends Hit
Modifier and Type | Class and Description |
---|---|
private static class |
FastHit.LazyString |
private static class |
FastHit.LazyValue |
static class |
FastHit.RawField |
Modifier and Type | Field and Description |
---|---|
private CacheKey |
cacheKey |
private int |
distributionKey
DistributionKey (needed to generate getDocsumPacket, for two-phase search)
|
private com.yahoo.document.GlobalId |
globalId
The global id of this document in the backend node which produced it
|
private boolean |
ignoreRowBits
Whether or not to ignore the row bits.
|
private com.yahoo.net.URI |
indexUri
The index uri of this.
|
private int |
partId
Part ID
|
private QueryPacketData |
queryPacketData |
private int |
rowBits
The number of least significant bits in the part id which specifies the
row in the search cluster which produced this hit.
|
private static long |
serialVersionUID |
static String |
SUMMARY |
private boolean |
useRowInIndexUri
Whether to use the row number in the index uri, see FastSearcher for details
|
RANKFEATURES_FIELD, SDDOCNAME_FIELD
Constructor and Description |
---|
FastHit()
Creates an empty and temporarily invalid summary hit
|
FastHit(String uri,
double relevancy) |
FastHit(String uri,
double relevance,
String source) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addSummary(DocsumDefinition docsumDef,
com.yahoo.data.access.Inspector value) |
static String |
asHexString(com.yahoo.document.GlobalId gid) |
FastHit.RawField |
fetchFieldAsUtf8(String fieldName) |
boolean |
fieldIsNotDecoded(String name) |
private Object |
getAndCacheLazyValue(String key,
FastHit.LazyValue value) |
(package private) CacheKey |
getCacheKey() |
int |
getColumn()
Returns the column number where this hit originated, or partId if not known
|
int |
getDistributionKey()
Only needed when fetching summaries in 2 phase.
|
Object |
getField(String key)
Returns a field value from this Hit.
|
com.yahoo.document.GlobalId |
getGlobalId()
Returns the global id of this document in the backend node which produced it
|
com.yahoo.net.URI |
getId()
Returns the hit id
|
com.yahoo.net.URI |
getIndexUri()
The uri of the index location of this hit ("index:[source]/[partid]/[id]").
|
int |
getPartId() |
QueryPacketData |
getQueryPacketData()
Fetch binary data from the query packet which produced this hit.
|
int |
getRow()
Returns the row number where this hit originated, or 0 if not known
|
com.yahoo.net.URI |
getUri()
Returns the explicitly set uri if available, returns "index:[source]/[partid]/[id]" otherwise
|
int |
hashCode()
Returns the hashCode of this hit, which is the hashcode of its uri.
|
boolean |
isMeta()
Returns false - this is a concrete hit containing requested content
|
(package private) void |
setCacheKey(CacheKey cacheKey) |
void |
setDistributionKey(int distributionKey)
Only needed when fetching summaries in 2 phase.
|
private void |
setDocsumFieldIfNotPresent(String fieldName,
Object value) |
void |
setGlobalId(com.yahoo.document.GlobalId globalId) |
void |
setIgnoreRowBits(boolean ignoreRowBits) |
void |
setLazyStringField(String fieldName,
byte[] value)
Set a field to behave like a string type summary field, not decoding raw
data till actually used.
|
void |
setPartId(int partId,
int rowBits)
Sets the part id number, which specifies the node where this hit is
found.
|
void |
setQueryPacketData(QueryPacketData queryPacketData)
Add the binary data common for the query packet to a Vespa backend and a
summary fetch packet to a Vespa backend.
|
void |
setUseRowInIndexUri(boolean useRowInIndexUri)
Sets whether to use the row in the index uri.
|
boolean |
shouldIgnoreRowBits() |
String |
toString()
Returns a string describing this hit
|
assignId, buildHitField, buildHitField, buildHitField, changeFieldKey, clearFields, clone, compareTo, equals, fieldIterator, fieldKeys, fields, getAddNumber, getDisplayId, getFieldXML, getFilled, getFilledInternal, getQuery, getRelevance, getSearcherSpecificMetaData, getSource, getSourceNumber, getTypeString, getUnboldedField, isAuxiliary, isCached, isFillable, isFilled, removeField, request, reserve, setAddNumber, setAuxiliary, setCached, setField, setFillable, setFilled, setFilledInternal, setId, setId, setMeta, setQuery, setRelevance, setRelevance, setSearcherSpecificMetaData, setSource, setSourceNumber, stripCharacter, types
addFreezeListener, freeze
public static final String SUMMARY
private static final long serialVersionUID
private com.yahoo.document.GlobalId globalId
private int partId
private int distributionKey
private com.yahoo.net.URI indexUri
private int rowBits
private boolean ignoreRowBits
private boolean useRowInIndexUri
private transient QueryPacketData queryPacketData
private transient CacheKey cacheKey
public FastHit()
public FastHit(String uri, double relevancy)
public String toString()
Hit
public static String asHexString(com.yahoo.document.GlobalId gid)
public int hashCode()
Hit
public com.yahoo.net.URI getId()
Hit
public com.yahoo.net.URI getUri()
public com.yahoo.net.URI getIndexUri()
public com.yahoo.document.GlobalId getGlobalId()
public void setGlobalId(com.yahoo.document.GlobalId globalId)
public int getPartId()
public void setPartId(int partId, int rowBits)
partId
- partition idrowBits
- number of bits to encode row numberpublic void setUseRowInIndexUri(boolean useRowInIndexUri)
public int getColumn()
public int getRow()
public Object getField(String key)
Returns a field value from this Hit. The value is either a stored value from the Document represented by this Hit, or a generated value added during later processing.
The values available from the matching Document are a subset of the values set in the document,
determined by the filled
status of this Hit. More fields may be requested by requesting
further filling.
Lookups on names which does not exists in the document and is not added by later processing return null.
Lookups on fields which exist in the document, in a summary class which is already requested filled returns the following types, even when the field has no actual value:
NanNumber.NaN
is returned.
RawData
instance
Tensor
instance
Inspector
instance
private Object getAndCacheLazyValue(String key, FastHit.LazyValue value)
public boolean isMeta()
public int getDistributionKey()
public void setDistributionKey(int distributionKey)
distributionKey
- Of node where you find this hit.void addSummary(DocsumDefinition docsumDef, com.yahoo.data.access.Inspector value)
@Beta public void setLazyStringField(String fieldName, byte[] value)
fieldName
- the name of the field to insert undecoded UTF-8 intovalue
- an array of valid UTF-8 datapublic void setQueryPacketData(QueryPacketData queryPacketData)
queryPacketData
- binary data from a query packet resulting in this hitIllegalStateException
- if the method is called more than onceNullPointerException
- if trying to set query packet data to nullpublic QueryPacketData getQueryPacketData()
CacheKey getCacheKey()
void setCacheKey(CacheKey cacheKey)
public void setIgnoreRowBits(boolean ignoreRowBits)
public boolean shouldIgnoreRowBits()
public boolean fieldIsNotDecoded(String name)
public FastHit.RawField fetchFieldAsUtf8(String fieldName)
Copyright © 2018. All rights reserved.