Class CollapseBuilder
- java.lang.Object
-
- org.elasticsearch.search.collapse.CollapseBuilder
-
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentObject
public class CollapseBuilder extends java.lang.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 ParseField
FIELD_FIELD
static ParseField
INNER_HITS_FIELD
static ParseField
MAX_CONCURRENT_GROUP_REQUESTS_FIELD
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description CollapseBuilder(java.lang.String field)
Public constructorCollapseBuilder(StreamInput in)
-
Method Summary
Modifier and Type Method Description CollapseContext
build(SearchContext context)
boolean
equals(java.lang.Object o)
static CollapseBuilder
fromXContent(XContentParser parser)
java.lang.String
getField()
The name of the field to collapse againstjava.util.List<InnerHitBuilder>
getInnerHits()
The inner hit options to expand the collapsed resultsint
getMaxConcurrentGroupRequests()
Returns the amount of group requests that are allowed to be ran concurrently in the inner_hits phase.int
hashCode()
CollapseBuilder
setInnerHits(java.util.List<InnerHitBuilder> innerHits)
CollapseBuilder
setInnerHits(InnerHitBuilder innerHit)
CollapseBuilder
setMaxConcurrentGroupRequests(int num)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(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(java.lang.String field)
Public constructor- Parameters:
field
- The name of the field to collapse on
-
CollapseBuilder
public CollapseBuilder(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.
-
fromXContent
public static CollapseBuilder fromXContent(XContentParser parser)
-
setInnerHits
public CollapseBuilder setInnerHits(InnerHitBuilder innerHit)
-
setInnerHits
public CollapseBuilder setInnerHits(java.util.List<InnerHitBuilder> innerHits)
-
setMaxConcurrentGroupRequests
public CollapseBuilder setMaxConcurrentGroupRequests(int num)
-
getField
public java.lang.String getField()
The name of the field to collapse against
-
getInnerHits
public java.util.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 java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
build
public CollapseContext build(SearchContext context)
-
-