Class CollapseBuilder
- java.lang.Object
-
- org.elasticsearch.search.collapse.CollapseBuilder
-
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
public class CollapseBuilder extends Object implements Writeable, ToXContentObject
A builder that enables field collapsing on search request.
-
-
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 ParseFieldFIELD_FIELDstatic ParseFieldINNER_HITS_FIELDstatic ParseFieldMAX_CONCURRENT_GROUP_REQUESTS_FIELD-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description CollapseBuilder(String field)Public constructorCollapseBuilder(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CollapseContextbuild(QueryShardContext queryShardContext)booleanequals(Object o)static CollapseBuilderfromXContent(XContentParser parser)StringgetField()The name of the field to collapse againstList<InnerHitBuilder>getInnerHits()The inner hit options to expand the collapsed resultsintgetMaxConcurrentGroupRequests()Returns the amount of group requests that are allowed to be ran concurrently in the inner_hits phase.inthashCode()CollapseBuildersetInnerHits(List<InnerHitBuilder> innerHits)CollapseBuildersetInnerHits(InnerHitBuilder innerHit)CollapseBuildersetMaxConcurrentGroupRequests(int num)XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
FIELD_FIELD
public static final ParseField FIELD_FIELD
-
INNER_HITS_FIELD
public static final ParseField INNER_HITS_FIELD
-
MAX_CONCURRENT_GROUP_REQUESTS_FIELD
public static final ParseField MAX_CONCURRENT_GROUP_REQUESTS_FIELD
-
-
Constructor Detail
-
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 Detail
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
fromXContent
public static CollapseBuilder fromXContent(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 XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
build
public CollapseContext build(QueryShardContext queryShardContext)
-
-