public class SearchDocumentAdapter extends Object implements SearchDocument
SearchDocument implementation using a Document delegate.| Constructor and Description |
|---|
SearchDocumentAdapter(Document delegate,
float score,
Object[] sortValues,
Map<String,List<Object>> fields,
Map<String,List<String>> highlightFields,
Map<String,SearchDocumentResponse> innerHits,
NestedMetaData nestedMetaData,
Explanation explanation,
List<String> matchedQueries,
String routing) |
| Modifier and Type | Method and Description |
|---|---|
SearchDocument |
append(String key,
Object value)
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
boolean |
equals(Object o) |
void |
forEach(BiConsumer<? super String,? super Object> action) |
Object |
get(Object key) |
<T> T |
get(Object key,
Class<T> type)
Returns the value to which the specified
key is mapped, or null if this document contains no
mapping for the key. |
Explanation |
getExplanation() |
Map<String,List<Object>> |
getFields() |
Map<String,List<String>> |
getHighlightFields() |
String |
getId()
Retrieve the identifier associated with this
Document. |
String |
getIndex() |
Map<String,SearchDocumentResponse> |
getInnerHits() |
List<String> |
getMatchedQueries() |
NestedMetaData |
getNestedMetaData() |
long |
getPrimaryTerm()
Retrieve the primary_term associated with this
Document. |
String |
getRouting() |
float |
getScore()
Return the search
score. |
long |
getSeqNo()
Retrieve the seq_no associated with this
Document. |
Object[] |
getSortValues() |
long |
getVersion()
Retrieve the version associated with this
Document. |
int |
hashCode() |
boolean |
hasId()
Return true if this
Document is associated with an identifier. |
boolean |
hasPrimaryTerm()
Return true if this
Document is associated with a primary_term. |
boolean |
hasSeqNo()
Return true if this
Document is associated with a seq_no. |
boolean |
hasVersion()
Return true if this
Document is associated with a version. |
boolean |
isEmpty() |
Set<String> |
keySet() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,?> m) |
Object |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
void |
setId(String id)
Set the identifier for this
Document. |
void |
setPrimaryTerm(long primaryTerm)
Set the primary_term for this
Document. |
void |
setSeqNo(long seqNo)
Set the seq_no for this
Document. |
void |
setVersion(long version)
Set the version for this
Document. |
int |
size() |
String |
toJson()
Render this
Document to JSON. |
String |
toString() |
Collection<Object> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFieldValuecreate, from, fromJson, parse, setIndex, transformgetBoolean, getBooleanOrDefault, getBooleanOrDefault, getInt, getIntOrDefault, getIntOrDefault, getLong, getLongOrDefault, getLongOrDefault, getString, getStringOrDefault, getStringOrDefaultcompute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, replace, replace, replaceAllpublic SearchDocumentAdapter(Document delegate, float score, Object[] sortValues, Map<String,List<Object>> fields, Map<String,List<String>> highlightFields, Map<String,SearchDocumentResponse> innerHits, @Nullable NestedMetaData nestedMetaData, @Nullable Explanation explanation, @Nullable List<String> matchedQueries, @Nullable String routing)
public SearchDocument append(String key, Object value)
StringObjectMapappend in interface StringObjectMap<Document>key - key with which the specified value is to be associated. must not be null.value - value to be associated with the specified key.this object.public float getScore()
SearchDocumentscore.getScore in interface SearchDocumentscore.public Map<String,List<Object>> getFields()
getFields in interface SearchDocumentpublic Object[] getSortValues()
getSortValues in interface SearchDocumentpublic Map<String,List<String>> getHighlightFields()
getHighlightFields in interface SearchDocumentpublic String getIndex()
public boolean hasId()
DocumentDocument is associated with an identifier.public String getId()
DocumentDocument.
The default implementation throws UnsupportedOperationException. It's recommended to check Document.hasId()
prior to calling this method.
public void setId(String id)
DocumentDocument.
The default implementation throws UnsupportedOperationException.
public boolean hasVersion()
DocumentDocument is associated with a version.hasVersion in interface DocumentDocument is associated with a version, false otherwise.public long getVersion()
DocumentDocument.
The default implementation throws UnsupportedOperationException. It's recommended to check
Document.hasVersion() prior to calling this method.
getVersion in interface DocumentDocument.public void setVersion(long version)
DocumentDocument.
The default implementation throws UnsupportedOperationException.
setVersion in interface Documentpublic boolean hasSeqNo()
DocumentDocument is associated with a seq_no.public long getSeqNo()
DocumentDocument.
The default implementation throws UnsupportedOperationException. It's recommended to check
Document.hasSeqNo() prior to calling this method.
public void setSeqNo(long seqNo)
DocumentDocument.
The default implementation throws UnsupportedOperationException.
public boolean hasPrimaryTerm()
DocumentDocument is associated with a primary_term.hasPrimaryTerm in interface DocumentDocument is associated with a primary_term, false otherwise.public long getPrimaryTerm()
DocumentDocument.
The default implementation throws UnsupportedOperationException. It's recommended to check
Document.hasPrimaryTerm() prior to calling this method.
getPrimaryTerm in interface DocumentDocument.public void setPrimaryTerm(long primaryTerm)
DocumentDocument.
The default implementation throws UnsupportedOperationException.
setPrimaryTerm in interface Documentpublic Map<String,SearchDocumentResponse> getInnerHits()
getInnerHits in interface SearchDocument@Nullable public NestedMetaData getNestedMetaData()
getNestedMetaData in interface SearchDocument@Nullable public <T> T get(Object key, Class<T> type)
StringObjectMapkey is mapped, or null if this document contains no
mapping for the key. The value is casted within the method which makes it useful for calling code as it does not
require casting on the calling side. If the value type is not assignable to type, then this method throws
ClassCastException.get in interface StringObjectMap<Document>T - expected return type.key - the key whose associated value is to be returnedtype - the expected return value type.public String toJson()
StringObjectMapDocument to JSON. Auxiliary values such as Id and version are not considered within the JSON
representation.toJson in interface StringObjectMap<Document>public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>@Nullable public Explanation getExplanation()
getExplanation in interface SearchDocument@Nullable public List<String> getMatchedQueries()
getMatchedQueries in interface SearchDocumentpublic boolean equals(Object o)
public int hashCode()
public void forEach(BiConsumer<? super String,? super Object> action)
public String getRouting()
getRouting in interface SearchDocumentCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.