Class CollapseBuilder

java.lang.Object
org.elasticsearch.search.collapse.CollapseBuilder
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject

public class CollapseBuilder extends Object implements Writeable, org.elasticsearch.common.xcontent.ToXContentObject
A builder that enables field collapsing on search request.
  • Field Details

    • FIELD_FIELD

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

      public static final org.elasticsearch.common.xcontent.ParseField INNER_HITS_FIELD
    • MAX_CONCURRENT_GROUP_REQUESTS_FIELD

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

    • CollapseBuilder

      public CollapseBuilder(String field)
      Public constructor
      Parameters:
      field - The name of the field to collapse on
    • CollapseBuilder

      public CollapseBuilder(StreamInput in) throws IOException
      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
    • fromXContent

      public static CollapseBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
    • setInnerHits

      public CollapseBuilder setInnerHits(InnerHitBuilder innerHit)
    • setInnerHits

      public CollapseBuilder setInnerHits(List<InnerHitBuilder> innerHits)
    • setMaxConcurrentGroupRequests

      public CollapseBuilder setMaxConcurrentGroupRequests(int num)
    • getField

      public String getField()
      The name of the field to collapse against
    • getInnerHits

      public List<InnerHitBuilder> getInnerHits()
      The inner hit options to expand the collapsed results
    • getMaxConcurrentGroupRequests

      public int getMaxConcurrentGroupRequests()
      Returns the amount of group requests that are allowed to be ran concurrently in the inner_hits phase.
    • 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
    • build

      public CollapseContext build(SearchExecutionContext searchExecutionContext)