public class PercolateSourceBuilder extends ToXContentToBytes
Modifier and Type | Class and Description |
---|---|
static class |
PercolateSourceBuilder.DocBuilder
A builder for defining the document to be percolated in various ways.
|
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
PercolateSourceBuilder() |
Modifier and Type | Method and Description |
---|---|
PercolateSourceBuilder |
addAggregation(AbstractAggregationBuilder aggregationBuilder)
Add an aggregation definition.
|
PercolateSourceBuilder |
addSort(SortBuilder sort)
Adds a sort builder.
|
static PercolateSourceBuilder.DocBuilder |
docBuilder() |
PercolateSourceBuilder |
setDoc(PercolateSourceBuilder.DocBuilder docBuilder)
Sets the document to run the percolate queries against.
|
PercolateSourceBuilder |
setHighlightBuilder(HighlightBuilder highlightBuilder)
Enables highlighting for the percolate document.
|
PercolateSourceBuilder |
setQueryBuilder(QueryBuilder queryBuilder)
Sets a query to reduce the number of percolate queries to be evaluated and score the queries that match based
on this query.
|
PercolateSourceBuilder |
setSize(int size)
Limits the maximum number of percolate query matches to be returned.
|
PercolateSourceBuilder |
setSort(boolean sort)
Similar as
setTrackScores(boolean) , but whether to sort by the score descending. |
PercolateSourceBuilder |
setTrackScores(boolean trackScores)
Whether to compute a score for each match and include it in the response.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
buildAsBytes, buildAsBytes, toString
public PercolateSourceBuilder setDoc(PercolateSourceBuilder.DocBuilder docBuilder)
public PercolateSourceBuilder setQueryBuilder(QueryBuilder queryBuilder)
public PercolateSourceBuilder setSize(int size)
public PercolateSourceBuilder setSort(boolean sort)
setTrackScores(boolean)
, but whether to sort by the score descending.public PercolateSourceBuilder addSort(SortBuilder sort)
public PercolateSourceBuilder setTrackScores(boolean trackScores)
setQueryBuilder(QueryBuilder)
.public PercolateSourceBuilder setHighlightBuilder(HighlightBuilder highlightBuilder)
public PercolateSourceBuilder addAggregation(AbstractAggregationBuilder aggregationBuilder)
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
public static PercolateSourceBuilder.DocBuilder docBuilder()
PercolateSourceBuilder.DocBuilder
instance.Copyright © 2009–2016. All rights reserved.