|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.search.internal.InternalSearchHit
public class InternalSearchHit
Nested Class Summary | |
---|---|
static class |
InternalSearchHit.Fields
|
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent |
---|
ToXContent.MapParams, ToXContent.Params |
Field Summary |
---|
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent |
---|
EMPTY_PARAMS |
Constructor Summary | |
---|---|
InternalSearchHit(int docId,
String id,
String type,
byte[] source,
Map<String,SearchHitField> fields)
|
Method Summary | |
---|---|
int |
docId()
|
org.apache.lucene.search.Explanation |
explanation()
If enabled, the explanation of the search hit. |
void |
explanation(org.apache.lucene.search.Explanation explanation)
|
SearchHitField |
field(String fieldName)
The hit field matching the given field name. |
Map<String,SearchHitField> |
fields()
A map of hit fields (from field name to hit fields) if additional fields were required to be loaded. |
void |
fields(Map<String,SearchHitField> fields)
|
Map<String,SearchHitField> |
fieldsOrNull()
|
org.apache.lucene.search.Explanation |
getExplanation()
If enabled, the explanation of the search hit. |
Map<String,SearchHitField> |
getFields()
A map of hit fields (from field name to hit fields) if additional fields were required to be loaded. |
Map<String,HighlightField> |
getHighlightFields()
A map of highlighted fields. |
String |
getId()
The id of the document. |
String |
getIndex()
The index of the hit. |
String[] |
getMatchedFilters()
The set of filter names the query matched. |
float |
getScore()
The score. |
SearchShardTarget |
getShard()
The shard of the search hit. |
Object[] |
getSortValues()
An array of the sort values used. |
Map<String,Object> |
getSource()
The source of the document as a map (can be null). |
String |
getSourceAsString()
The source of the document as string (can be null). |
BytesReference |
getSourceRef()
Returns bytes reference, also un compress the source if needed. |
String |
getType()
The type of the document. |
long |
getVersion()
The version of the hit. |
Map<String,HighlightField> |
highlightFields()
A map of highlighted fields. |
void |
highlightFields(Map<String,HighlightField> highlightFields)
|
String |
id()
The id of the document. |
String |
index()
The index of the hit. |
Map<String,HighlightField> |
internalHighlightFields()
|
BytesReference |
internalSourceRef()
Internal source representation, might be compressed.... |
boolean |
isSourceEmpty()
Is the source empty (not available) or not. |
Iterator<SearchHitField> |
iterator()
|
String[] |
matchedFilters()
The set of filter names the query matched. |
void |
matchedFilters(String[] matchedFilters)
|
void |
readFrom(StreamInput in)
|
void |
readFrom(StreamInput in,
InternalSearchHits.StreamContext context)
|
static InternalSearchHit |
readSearchHit(StreamInput in,
InternalSearchHits.StreamContext context)
|
float |
score()
The score. |
void |
score(float score)
|
SearchShardTarget |
shard()
The shard of the search hit. |
void |
shard(SearchShardTarget target)
|
void |
shardTarget(SearchShardTarget shardTarget)
|
Object[] |
sortValues()
An array of the sort values used. |
void |
sortValues(Object[] sortValues)
|
byte[] |
source()
The source of the document (can be null). |
Map<String,Object> |
sourceAsMap()
The source of the document as a map (can be null). |
String |
sourceAsString()
The source of the document as string (can be null). |
BytesReference |
sourceRef()
Returns bytes reference, also un compress the source if needed. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params)
|
String |
type()
The type of the document. |
long |
version()
The version of the hit. |
void |
version(long version)
|
void |
writeTo(StreamOutput out)
|
void |
writeTo(StreamOutput out,
InternalSearchHits.StreamContext context)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InternalSearchHit(int docId, String id, String type, byte[] source, Map<String,SearchHitField> fields)
Method Detail |
---|
public int docId()
public void shardTarget(SearchShardTarget shardTarget)
public void score(float score)
public float score()
SearchHit
score
in interface SearchHit
public float getScore()
SearchHit
getScore
in interface SearchHit
public void version(long version)
public long version()
SearchHit
version
in interface SearchHit
public long getVersion()
SearchHit
getVersion
in interface SearchHit
public String index()
SearchHit
index
in interface SearchHit
public String getIndex()
SearchHit
getIndex
in interface SearchHit
public String id()
SearchHit
id
in interface SearchHit
public String getId()
SearchHit
getId
in interface SearchHit
public String type()
SearchHit
type
in interface SearchHit
public String getType()
SearchHit
getType
in interface SearchHit
public BytesReference sourceRef()
sourceRef
in interface SearchHit
public BytesReference getSourceRef()
SearchHit
getSourceRef
in interface SearchHit
public BytesReference internalSourceRef()
public byte[] source()
SearchHit
SearchHit.sourceRef()
so there won't be a need to copy.
source
in interface SearchHit
public boolean isSourceEmpty()
SearchHit
isSourceEmpty
in interface SearchHit
public Map<String,Object> getSource()
SearchHit
getSource
in interface SearchHit
public String sourceAsString()
SearchHit
sourceAsString
in interface SearchHit
public String getSourceAsString()
SearchHit
getSourceAsString
in interface SearchHit
public Map<String,Object> sourceAsMap() throws ElasticSearchParseException
SearchHit
sourceAsMap
in interface SearchHit
ElasticSearchParseException
public Iterator<SearchHitField> iterator()
iterator
in interface Iterable<SearchHitField>
public SearchHitField field(String fieldName)
SearchHit
field
in interface SearchHit
public Map<String,SearchHitField> fields()
SearchHit
fields
in interface SearchHit
public Map<String,SearchHitField> fieldsOrNull()
public Map<String,SearchHitField> getFields()
SearchHit
getFields
in interface SearchHit
public void fields(Map<String,SearchHitField> fields)
public Map<String,HighlightField> internalHighlightFields()
public Map<String,HighlightField> highlightFields()
SearchHit
highlightFields
in interface SearchHit
public Map<String,HighlightField> getHighlightFields()
SearchHit
getHighlightFields
in interface SearchHit
public void highlightFields(Map<String,HighlightField> highlightFields)
public void sortValues(Object[] sortValues)
public Object[] sortValues()
SearchHit
sortValues
in interface SearchHit
public Object[] getSortValues()
SearchHit
getSortValues
in interface SearchHit
public org.apache.lucene.search.Explanation explanation()
SearchHit
explanation
in interface SearchHit
public org.apache.lucene.search.Explanation getExplanation()
SearchHit
getExplanation
in interface SearchHit
public void explanation(org.apache.lucene.search.Explanation explanation)
public SearchShardTarget shard()
SearchHit
shard
in interface SearchHit
public SearchShardTarget getShard()
SearchHit
getShard
in interface SearchHit
public void shard(SearchShardTarget target)
public void matchedFilters(String[] matchedFilters)
public String[] matchedFilters()
SearchHit
matchedFilters
in interface SearchHit
public String[] getMatchedFilters()
SearchHit
getMatchedFilters
in interface SearchHit
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent
in interface ToXContent
IOException
public static InternalSearchHit readSearchHit(StreamInput in, InternalSearchHits.StreamContext context) throws IOException
IOException
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
public void readFrom(StreamInput in, InternalSearchHits.StreamContext context) throws IOException
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
public void writeTo(StreamOutput out, InternalSearchHits.StreamContext context) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |