public class FastHit extends Hit
Modifier and Type | Class and Description |
---|---|
private static class |
FastHit.FieldIterator
Iterator over all the field content of a FastHit
|
private static class |
FastHit.FieldNameIterator
Iterator over all the field names stored in a FastHit
|
private static class |
FastHit.FieldSet
A set view of all the field names in this hit.
|
private static class |
FastHit.SummaryData
Summary data (values of a number of fields) received for this hit
|
private static class |
FastHit.SummaryIterator<VALUE>
Abstract superclass of iterators over all the field content of a FastHit.
|
Hit.RawUtf8Consumer
Modifier and Type | Field and Description |
---|---|
private CacheKey |
cacheKey |
private int |
distributionKey
The index of the content node this hit originated at
|
private static com.yahoo.document.GlobalId |
emptyGlobalId |
private com.yahoo.document.GlobalId |
globalId
The global id of this document in the backend node which produced it
|
private com.yahoo.net.URI |
indexUri
Full information pointing to the location of further data for this hit.
|
private int |
partId
The local identifier of the content store for this hit on the node it originated at
|
private QueryPacketData |
queryPacketData |
private Set<String> |
removedFields
Removed field values, which should therefore not be returned if present in summary data
|
private List<FastHit.SummaryData> |
summaries
Summaries added to this hit which are not yet decoded into fields.
|
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 |
---|---|
void |
addSummary(DocsumDefinition docsumDef,
com.yahoo.data.access.Inspector value)
For internal use
|
static String |
asHexString(com.yahoo.document.GlobalId gid)
Deprecated.
do not use
|
private static StringBuilder |
asHexString(StringBuilder sb,
com.yahoo.document.GlobalId gid) |
void |
changeFieldKey(String oldKey,
String newKey)
Deprecated.
do not use
|
void |
clearFields()
Removes all fields of this
|
Iterator<Map.Entry<String,Object>> |
fieldIterator()
Returns a modifiable iterator over the fields of this
|
Set<String> |
fieldKeys()
Returns the keys of the fields of this hit as a modifiable view.
|
private Iterator<String> |
fieldNameIterator()
Returns a modifiable iterator over the field names of this
|
Map<String,Object> |
fields()
Returns the fields of this as a read-only map.
|
void |
forEachField(BiConsumer<String,Object> consumer)
Receive a callback on the given object for each field in this hit.
|
void |
forEachFieldAsRaw(Hit.RawUtf8Consumer consumer)
Receive a callback on the given object for each field in this hit,
where the callback will provide raw utf-8 byte data for strings whose data
is already available at this form.
|
(package private) CacheKey |
getCacheKey() |
int |
getDistributionKey()
Returns the index of the node this hit originated at
|
Object |
getField(String name)
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 explicitly set uri if available, returns "index:[source]/[partid]/[id]" otherwise
|
int |
getPartId() |
QueryPacketData |
getQueryPacketData()
Returns a serial encoding of the query which produced this hit, ot null if not available.
|
private Object |
getSummaryValue(String name) |
protected boolean |
hasField(String name)
Returns whether this field is present in the field map in the parent hit
|
protected boolean |
hasFields()
Returns whether any fields are present in the field map in the parent hit
|
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
|
private Set<String> |
mapFieldKeys() |
Object |
removeField(String name)
Removes a field from this
|
(package private) void |
setCacheKey(CacheKey cacheKey) |
void |
setDistributionKey(int distributionKey)
Sets the index of the node this hit originated at
|
Object |
setField(String name,
Object value)
Sets the value of a field
|
void |
setGlobalId(com.yahoo.document.GlobalId globalId) |
void |
setPartId(int partId)
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.
|
String |
toString() |
assignId, buildHitField, buildHitField, buildHitField, clone, close, compareTo, equals, getAddNumber, getDisplayId, getFieldXML, getFilled, getFilledInternal, getQuery, getRelevance, getSearcherSpecificMetaData, getSource, getSourceNumber, getTypeString, getUnboldedField, isAuxiliary, isCached, isFillable, isFilled, request, reserve, setAddNumber, setAuxiliary, setCached, setFillable, setFilled, setFilledInternal, setId, setId, setMeta, setQuery, setRelevance, setRelevance, setSearcherSpecificMetaData, setSource, setSourceNumber, stripCharacter, types
addFreezeListener, freeze
private static final com.yahoo.document.GlobalId emptyGlobalId
private int distributionKey
private int partId
private com.yahoo.document.GlobalId globalId
private com.yahoo.net.URI indexUri
private transient QueryPacketData queryPacketData
private transient CacheKey cacheKey
private List<FastHit.SummaryData> summaries
public FastHit()
public FastHit(String uri, double relevancy)
public boolean isMeta()
public com.yahoo.net.URI getId()
public com.yahoo.document.GlobalId getGlobalId()
public void setGlobalId(com.yahoo.document.GlobalId globalId)
public int getPartId()
public void setPartId(int partId)
public int getDistributionKey()
public void setDistributionKey(int distributionKey)
public 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 addSummary(DocsumDefinition docsumDef, com.yahoo.data.access.Inspector value)
public Object getField(String name)
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
public Object setField(String name, Object value)
Hit
public void forEachField(BiConsumer<String,Object> consumer)
Hit
forEachField
in class Hit
public void forEachFieldAsRaw(Hit.RawUtf8Consumer consumer)
Hit
forEachFieldAsRaw
in class Hit
public Map<String,Object> fields()
Hit
public Iterator<Map.Entry<String,Object>> fieldIterator()
Hit
fieldIterator
in class Hit
public Set<String> fieldKeys()
private Iterator<String> fieldNameIterator()
public void clearFields()
clearFields
in class Hit
public Object removeField(String name)
removeField
in class Hit
protected boolean hasField(String name)
protected boolean hasFields()
@Deprecated public void changeFieldKey(String oldKey, String newKey)
changeFieldKey
in class Hit
public int hashCode()
Hit
@Deprecated public static String asHexString(com.yahoo.document.GlobalId gid)
private static StringBuilder asHexString(StringBuilder sb, com.yahoo.document.GlobalId gid)
Copyright © 2018. All rights reserved.