Class CollapseBuilder

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

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

    • FIELD_FIELD

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

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

      public static final org.elasticsearch.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.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.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.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)