Package org.elasticsearch.index.query
Class InnerHitBuilder
- java.lang.Object
-
- org.elasticsearch.index.query.InnerHitBuilder
-
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public final class InnerHitBuilder extends java.lang.Object implements Writeable, ToXContentObject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static ParseFieldCOLLAPSE_FIELDstatic QueryBuilderDEFAULT_INNER_HIT_QUERYstatic ParseFieldFIELD_FIELDstatic ParseFieldIGNORE_UNMAPPEDstatic ParseFieldNAME_FIELD-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description InnerHitBuilder()InnerHitBuilder(java.lang.String name)InnerHitBuilder(StreamInput in)Read from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description InnerHitBuilderaddDocValueField(java.lang.String field)Adds a field to load from doc values and return.InnerHitBuilderaddDocValueField(java.lang.String field, java.lang.String format)Adds a field to load from the docvalue and return.InnerHitBuilderaddScriptField(java.lang.String name, Script script)InnerHitBuilderaddSort(SortBuilder<?> sort)booleanequals(java.lang.Object o)static InnerHitBuilderfromXContent(XContentParser parser)java.util.List<DocValueFieldsContext.FieldAndFormat>getDocValueFields()Gets the docvalue fields.FetchSourceContextgetFetchSourceContext()java.util.List<java.lang.String>getFieldNames()Deprecated.UsegetStoredFieldsContext()instead.intgetFrom()HighlightBuildergetHighlightBuilder()CollapseBuildergetInnerCollapseBuilder()java.lang.StringgetName()java.util.Set<SearchSourceBuilder.ScriptField>getScriptFields()intgetSize()java.util.List<SortBuilder<?>>getSorts()StoredFieldsContextgetStoredFieldsContext()Gets the stored fields context.inthashCode()booleanisExplain()booleanisIgnoreUnmapped()Whether to include inner hits in the search response hits if required mappings is missingbooleanisTrackScores()booleanisVersion()InnerHitBuildersetDocValueFields(java.util.List<DocValueFieldsContext.FieldAndFormat> docValueFields)Sets the stored fields to load from the docvalue and return.InnerHitBuildersetExplain(boolean explain)InnerHitBuildersetFetchSourceContext(FetchSourceContext fetchSourceContext)InnerHitBuildersetFieldNames(java.util.List<java.lang.String> fieldNames)Deprecated.UsesetStoredFieldNames(List)instead.InnerHitBuildersetFrom(int from)InnerHitBuildersetHighlightBuilder(HighlightBuilder highlightBuilder)InnerHitBuildersetIgnoreUnmapped(boolean value)InnerHitBuildersetInnerCollapse(CollapseBuilder innerCollapseBuilder)InnerHitBuildersetName(java.lang.String name)InnerHitBuildersetScriptFields(java.util.Set<SearchSourceBuilder.ScriptField> scriptFields)InnerHitBuildersetSize(int size)InnerHitBuildersetSorts(java.util.List<SortBuilder<?>> sorts)InnerHitBuildersetStoredFieldNames(java.util.List<java.lang.String> fieldNames)Sets the stored fields to load and return.InnerHitBuildersetTrackScores(boolean trackScores)InnerHitBuildersetVersion(boolean version)java.lang.StringtoString()XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.voidwriteToCollapseBWC(StreamOutput out)BWC serialization for collapsingInnerHitBuilder.protected voidwriteToNestedBWC(StreamOutput out, QueryBuilder query, java.lang.String nestedPath)BWC serialization for nestedInnerHitBuilder.voidwriteToParentChildBWC(StreamOutput out, QueryBuilder query, java.lang.String parentChildPath)BWC serialization for parent/childInnerHitBuilder.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME_FIELD
public static final ParseField NAME_FIELD
-
IGNORE_UNMAPPED
public static final ParseField IGNORE_UNMAPPED
-
DEFAULT_INNER_HIT_QUERY
public static final QueryBuilder DEFAULT_INNER_HIT_QUERY
-
COLLAPSE_FIELD
public static final ParseField COLLAPSE_FIELD
-
FIELD_FIELD
public static final ParseField FIELD_FIELD
-
-
Constructor Detail
-
InnerHitBuilder
public InnerHitBuilder()
-
InnerHitBuilder
public InnerHitBuilder(java.lang.String name)
-
InnerHitBuilder
public InnerHitBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.
-
writeToNestedBWC
protected void writeToNestedBWC(StreamOutput out, QueryBuilder query, java.lang.String nestedPath) throws java.io.IOException
BWC serialization for nestedInnerHitBuilder. Should only be used to send nested inner hits to nodes pre 5.5.- Throws:
java.io.IOException
-
writeToCollapseBWC
public void writeToCollapseBWC(StreamOutput out) throws java.io.IOException
BWC serialization for collapsingInnerHitBuilder. Should only be used to send collapsing inner hits to nodes pre 5.5.- Throws:
java.io.IOException
-
writeToParentChildBWC
public void writeToParentChildBWC(StreamOutput out, QueryBuilder query, java.lang.String parentChildPath) throws java.io.IOException
BWC serialization for parent/childInnerHitBuilder. Should only be used to send hasParent or hasChild inner hits to nodes pre 5.5.- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
-
setName
public InnerHitBuilder setName(java.lang.String name)
-
setIgnoreUnmapped
public InnerHitBuilder setIgnoreUnmapped(boolean value)
-
isIgnoreUnmapped
public boolean isIgnoreUnmapped()
Whether to include inner hits in the search response hits if required mappings is missing
-
getFrom
public int getFrom()
-
setFrom
public InnerHitBuilder setFrom(int from)
-
getSize
public int getSize()
-
setSize
public InnerHitBuilder setSize(int size)
-
isExplain
public boolean isExplain()
-
setExplain
public InnerHitBuilder setExplain(boolean explain)
-
isVersion
public boolean isVersion()
-
setVersion
public InnerHitBuilder setVersion(boolean version)
-
isTrackScores
public boolean isTrackScores()
-
setTrackScores
public InnerHitBuilder setTrackScores(boolean trackScores)
-
getFieldNames
@Deprecated public java.util.List<java.lang.String> getFieldNames()
Deprecated.UsegetStoredFieldsContext()instead.Gets the stored fields to load and return.
-
setFieldNames
@Deprecated public InnerHitBuilder setFieldNames(java.util.List<java.lang.String> fieldNames)
Deprecated.UsesetStoredFieldNames(List)instead.Sets the stored fields to load and return. If none are specified, the source of the document will be returned.
-
getStoredFieldsContext
public StoredFieldsContext getStoredFieldsContext()
Gets the stored fields context.
-
setStoredFieldNames
public InnerHitBuilder setStoredFieldNames(java.util.List<java.lang.String> fieldNames)
Sets the stored fields to load and return. If none are specified, the source of the document will be returned.
-
getDocValueFields
public java.util.List<DocValueFieldsContext.FieldAndFormat> getDocValueFields()
Gets the docvalue fields.
-
setDocValueFields
public InnerHitBuilder setDocValueFields(java.util.List<DocValueFieldsContext.FieldAndFormat> docValueFields)
Sets the stored fields to load from the docvalue and return.
-
addDocValueField
public InnerHitBuilder addDocValueField(java.lang.String field, java.lang.String format)
Adds a field to load from the docvalue and return.
-
addDocValueField
public InnerHitBuilder addDocValueField(java.lang.String field)
Adds a field to load from doc values and return.
-
getScriptFields
public java.util.Set<SearchSourceBuilder.ScriptField> getScriptFields()
-
setScriptFields
public InnerHitBuilder setScriptFields(java.util.Set<SearchSourceBuilder.ScriptField> scriptFields)
-
addScriptField
public InnerHitBuilder addScriptField(java.lang.String name, Script script)
-
getFetchSourceContext
public FetchSourceContext getFetchSourceContext()
-
setFetchSourceContext
public InnerHitBuilder setFetchSourceContext(FetchSourceContext fetchSourceContext)
-
getSorts
public java.util.List<SortBuilder<?>> getSorts()
-
setSorts
public InnerHitBuilder setSorts(java.util.List<SortBuilder<?>> sorts)
-
addSort
public InnerHitBuilder addSort(SortBuilder<?> sort)
-
getHighlightBuilder
public HighlightBuilder getHighlightBuilder()
-
setHighlightBuilder
public InnerHitBuilder setHighlightBuilder(HighlightBuilder highlightBuilder)
-
setInnerCollapse
public InnerHitBuilder setInnerCollapse(CollapseBuilder innerCollapseBuilder)
-
getInnerCollapseBuilder
public CollapseBuilder getInnerCollapseBuilder()
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
fromXContent
public static InnerHitBuilder fromXContent(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-