Class InnerHitBuilder

java.lang.Object
org.elasticsearch.index.query.InnerHitBuilder
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public final class InnerHitBuilder extends Object implements Writeable, org.elasticsearch.common.xcontent.ToXContentObject
  • Field Details

    • NAME_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField NAME_FIELD
    • IGNORE_UNMAPPED

      public static final org.elasticsearch.common.xcontent.ParseField IGNORE_UNMAPPED
    • DEFAULT_INNER_HIT_QUERY

      public static final QueryBuilder DEFAULT_INNER_HIT_QUERY
    • COLLAPSE_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField COLLAPSE_FIELD
    • FIELD_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField FIELD_FIELD
  • Constructor Details

    • InnerHitBuilder

      public InnerHitBuilder()
    • InnerHitBuilder

      public InnerHitBuilder(String name)
    • InnerHitBuilder

      public InnerHitBuilder(StreamInput in) throws IOException
      Read from a stream.
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • getName

      public String getName()
    • setName

      public InnerHitBuilder setName(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)
    • isSeqNoAndPrimaryTerm

      public boolean isSeqNoAndPrimaryTerm()
    • setSeqNoAndPrimaryTerm

      public InnerHitBuilder setSeqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm)
    • isTrackScores

      public boolean isTrackScores()
    • setTrackScores

      public InnerHitBuilder setTrackScores(boolean trackScores)
    • getStoredFieldsContext

      public StoredFieldsContext getStoredFieldsContext()
      Gets the stored fields context.
    • setStoredFieldNames

      public InnerHitBuilder setStoredFieldNames(List<String> fieldNames)
      Sets the stored fields to load and return. If none are specified, the source of the document will be returned.
    • getDocValueFields

      public List<FieldAndFormat> getDocValueFields()
      Gets the docvalue fields.
    • setDocValueFields

      public InnerHitBuilder setDocValueFields(List<FieldAndFormat> docValueFields)
      Sets the stored fields to load from the docvalue and return.
    • addDocValueField

      public InnerHitBuilder addDocValueField(String field, String format)
      Adds a field to load from the docvalue and return.
    • addDocValueField

      public InnerHitBuilder addDocValueField(String field)
      Adds a field to load from doc values and return.
    • getFetchFields

      public List<FieldAndFormat> getFetchFields()
      Gets the fields to load and return as part of the search request.
    • setFetchFields

      public InnerHitBuilder setFetchFields(List<FieldAndFormat> fetchFields)
      Sets the stored fields to load and return as part of the search request.
    • addFetchField

      public InnerHitBuilder addFetchField(String name)
      Adds a field to load and return as part of the search request.
    • addFetchField

      public InnerHitBuilder addFetchField(String name, @Nullable String format)
      Adds a field to load and return as part of the search request.
      Parameters:
      name - the field name.
      format - an optional format string used when formatting values, for example a date format.
    • addFetchField

      public InnerHitBuilder addFetchField(String name, @Nullable String format, Boolean includeUnmapped)
      Adds a field to load and return as part of the search request.
      Parameters:
      name - the field name.
      format - an optional format string used when formatting values, for example a date format.
      includeUnmapped - whether unmapped fields should be returned as well
    • getScriptFields

      public Set<SearchSourceBuilder.ScriptField> getScriptFields()
    • setScriptFields

      public InnerHitBuilder setScriptFields(Set<SearchSourceBuilder.ScriptField> scriptFields)
    • addScriptField

      public InnerHitBuilder addScriptField(String name, Script script)
    • getFetchSourceContext

      public FetchSourceContext getFetchSourceContext()
    • setFetchSourceContext

      public InnerHitBuilder setFetchSourceContext(FetchSourceContext fetchSourceContext)
    • getSorts

      public List<SortBuilder<?>> getSorts()
    • setSorts

      public InnerHitBuilder setSorts(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 org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromXContent

      public static InnerHitBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object