|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.elasticsearch.index.query.xcontent.QueryBuilders
public abstract class QueryBuilders
A static factory for simple "import static" usage.
Method Summary | |
---|---|
static BoolQueryBuilder |
boolQuery()
A Query that matches documents matching boolean combinations of other queries. |
static ConstantScoreQueryBuilder |
constantScoreQuery(XContentFilterBuilder filterBuilder)
A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter. |
static CustomBoostFactorQueryBuilder |
customBoostFactorQuery(XContentQueryBuilder queryBuilder)
A query that simply applies the boost fact to the wrapped query (multiplies it). |
static CustomScoreQueryBuilder |
customScoreQuery(XContentQueryBuilder queryBuilder)
A query that allows to define a custom scoring script. |
static DisMaxQueryBuilder |
disMaxQuery()
A query that generates the union of documents produced by its sub-queries, and that scores each document with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any additional matching sub-queries. |
static FieldMaskingSpanQueryBuilder |
fieldMaskingSpanQuery(XContentSpanQueryBuilder query,
java.lang.String field)
|
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
boolean query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
double query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
float query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
int query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
long query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
java.lang.Object query)
A query that executes the query string against a field. |
static FieldQueryBuilder |
fieldQuery(java.lang.String name,
java.lang.String query)
A query that executes the query string against a field. |
static FilteredQueryBuilder |
filtered(XContentQueryBuilder queryBuilder,
XContentFilterBuilder filterBuilder)
Deprecated. Use filteredQuery instead (rename) |
static FilteredQueryBuilder |
filteredQuery(XContentQueryBuilder queryBuilder,
XContentFilterBuilder filterBuilder)
A query that applies a filter to the results of another query. |
static FuzzyLikeThisFieldQueryBuilder |
fuzzyLikeThisFieldQuery(java.lang.String name)
A fuzzy like this query that finds documents that are "like" the provided FuzzyLikeThisFieldQueryBuilder.likeText(String) . |
static FuzzyLikeThisQueryBuilder |
fuzzyLikeThisQuery()
A fuzzy like this query that finds documents that are "like" the provided FuzzyLikeThisQueryBuilder.likeText(String)
which is checked against the "_all" field. |
static FuzzyLikeThisQueryBuilder |
fuzzyLikeThisQuery(java.lang.String... fields)
A fuzzy like this query that finds documents that are "like" the provided FuzzyLikeThisQueryBuilder.likeText(String)
which is checked against the fields the query is constructed with. |
static FuzzyQueryBuilder |
fuzzyQuery(java.lang.String name,
java.lang.String value)
A Query that matches documents using fuzzy query. |
static HasChildQueryBuilder |
hasChildQuery(java.lang.String type,
XContentQueryBuilder query)
Constructs a new NON scoring child query, with the child type and the query to run on the child documents. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
double... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
float... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
int... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
long... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
java.lang.Object... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
inQuery(java.lang.String name,
java.lang.String... values)
A filer for a field based on several terms matching on any of them. |
static PrefixFilterBuilder |
inQuery(java.lang.String name,
java.lang.String prefix)
A filter that restricts search results to values that have a matching prefix in a given field. |
static MatchAllQueryBuilder |
matchAllQuery()
A query that match on all documents. |
static MoreLikeThisFieldQueryBuilder |
moreLikeThisFieldQuery(java.lang.String name)
A more like this query that runs against a specific field. |
static MoreLikeThisQueryBuilder |
moreLikeThisQuery()
A more like this query that finds documents that are "like" the provided MoreLikeThisQueryBuilder.likeText(String)
which is checked against the "_all" field. |
static MoreLikeThisQueryBuilder |
moreLikeThisQuery(java.lang.String... fields)
A more like this query that finds documents that are "like" the provided MoreLikeThisQueryBuilder.likeText(String)
which is checked against the fields the query is constructed with. |
static PrefixQueryBuilder |
prefixQuery(java.lang.String name,
java.lang.String prefix)
A Query that matches documents containing terms with a specified prefix. |
static QueryStringQueryBuilder |
queryString(java.lang.String queryString)
A query that parses a query string and runs it. |
static RangeQueryBuilder |
rangeQuery(java.lang.String name)
A Query that matches documents within an range of terms. |
static SpanFirstQueryBuilder |
spanFirstQuery(XContentSpanQueryBuilder match,
int end)
|
static SpanNearQueryBuilder |
spanNearQuery()
|
static SpanNotQueryBuilder |
spanNotQuery()
|
static SpanOrQueryBuilder |
spanOrQuery()
|
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
double value)
|
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
float value)
|
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
int value)
|
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
long value)
|
static SpanTermQueryBuilder |
spanTermQuery(java.lang.String name,
java.lang.String value)
|
static TermQueryBuilder |
termQuery(java.lang.String name,
boolean value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
double value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
float value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
int value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
long value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
java.lang.Object value)
A Query that matches documents containing a term. |
static TermQueryBuilder |
termQuery(java.lang.String name,
java.lang.String value)
A Query that matches documents containing a term. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
double... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
float... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
int... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
long... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
java.lang.Object... values)
A filer for a field based on several terms matching on any of them. |
static TermsQueryBuilder |
termsQuery(java.lang.String name,
java.lang.String... values)
A filer for a field based on several terms matching on any of them. |
static TopChildrenQueryBuilder |
topChildrenQuery(java.lang.String type,
XContentQueryBuilder query)
Constructs a new scoring child query, with the child type and the query to run on the child documents. |
static WildcardQueryBuilder |
wildcardQuery(java.lang.String name,
java.lang.String query)
Implements the wildcard search query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MatchAllQueryBuilder matchAllQuery()
public static DisMaxQueryBuilder disMaxQuery()
public static TermQueryBuilder termQuery(java.lang.String name, java.lang.String value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, int value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, long value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, float value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, double value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, boolean value)
name
- The name of the fieldvalue
- The value of the termpublic static TermQueryBuilder termQuery(java.lang.String name, java.lang.Object value)
name
- The name of the fieldvalue
- The value of the termpublic static FuzzyQueryBuilder fuzzyQuery(java.lang.String name, java.lang.String value)
name
- The name of the fieldvalue
- The value of the termpublic static FieldQueryBuilder fieldQuery(java.lang.String name, java.lang.String query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldpublic static FieldQueryBuilder fieldQuery(java.lang.String name, int query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static FieldQueryBuilder fieldQuery(java.lang.String name, long query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static FieldQueryBuilder fieldQuery(java.lang.String name, float query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static FieldQueryBuilder fieldQuery(java.lang.String name, double query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static FieldQueryBuilder fieldQuery(java.lang.String name, boolean query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static FieldQueryBuilder fieldQuery(java.lang.String name, java.lang.Object query)
QueryStringQueryBuilder
that simply runs against
a single field.
name
- The name of the fieldquery
- The query stringpublic static PrefixQueryBuilder prefixQuery(java.lang.String name, java.lang.String prefix)
name
- The name of the fieldprefix
- The prefix querypublic static RangeQueryBuilder rangeQuery(java.lang.String name)
name
- The field namepublic static WildcardQueryBuilder wildcardQuery(java.lang.String name, java.lang.String query)
name
- The field namequery
- The wildcard query stringpublic static QueryStringQueryBuilder queryString(java.lang.String queryString)
QueryStringQueryBuilder.field(String)
, will run the query once and non prefixed fields
will use the QueryStringQueryBuilder.defaultField(String)
set. The second, when one or more fields are added
(using QueryStringQueryBuilder.field(String)
), will run the parsed query against the provided fields, and combine
them either using DisMax or a plain boolean query (see QueryStringQueryBuilder.useDisMax(boolean)
).
queryString
- The query string to runpublic static BoolQueryBuilder boolQuery()
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, java.lang.String value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, int value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, long value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, float value)
public static SpanTermQueryBuilder spanTermQuery(java.lang.String name, double value)
public static SpanFirstQueryBuilder spanFirstQuery(XContentSpanQueryBuilder match, int end)
public static SpanNearQueryBuilder spanNearQuery()
public static SpanNotQueryBuilder spanNotQuery()
public static SpanOrQueryBuilder spanOrQuery()
public static FieldMaskingSpanQueryBuilder fieldMaskingSpanQuery(XContentSpanQueryBuilder query, java.lang.String field)
public static FilteredQueryBuilder filtered(XContentQueryBuilder queryBuilder, XContentFilterBuilder filterBuilder)
queryBuilder
- The query to apply the filter tofilterBuilder
- The filter to apply on the querypublic static FilteredQueryBuilder filteredQuery(XContentQueryBuilder queryBuilder, XContentFilterBuilder filterBuilder)
queryBuilder
- The query to apply the filter tofilterBuilder
- The filter to apply on the querypublic static ConstantScoreQueryBuilder constantScoreQuery(XContentFilterBuilder filterBuilder)
filterBuilder
- The filter to wrap in a constant score querypublic static CustomBoostFactorQueryBuilder customBoostFactorQuery(XContentQueryBuilder queryBuilder)
queryBuilder
- The query to apply the boost factor to.public static CustomScoreQueryBuilder customScoreQuery(XContentQueryBuilder queryBuilder)
queryBuilder
- The query to custom scorepublic static MoreLikeThisQueryBuilder moreLikeThisQuery(java.lang.String... fields)
MoreLikeThisQueryBuilder.likeText(String)
which is checked against the fields the query is constructed with.
fields
- The fields to run the query againstpublic static MoreLikeThisQueryBuilder moreLikeThisQuery()
MoreLikeThisQueryBuilder.likeText(String)
which is checked against the "_all" field.
public static FuzzyLikeThisQueryBuilder fuzzyLikeThisQuery(java.lang.String... fields)
FuzzyLikeThisQueryBuilder.likeText(String)
which is checked against the fields the query is constructed with.
fields
- The fields to run the query againstpublic static FuzzyLikeThisQueryBuilder fuzzyLikeThisQuery()
FuzzyLikeThisQueryBuilder.likeText(String)
which is checked against the "_all" field.
public static FuzzyLikeThisFieldQueryBuilder fuzzyLikeThisFieldQuery(java.lang.String name)
FuzzyLikeThisFieldQueryBuilder.likeText(String)
.
public static MoreLikeThisFieldQueryBuilder moreLikeThisFieldQuery(java.lang.String name)
name
- The field namepublic static TopChildrenQueryBuilder topChildrenQuery(java.lang.String type, XContentQueryBuilder query)
type
- The child type.query
- The query.public static HasChildQueryBuilder hasChildQuery(java.lang.String type, XContentQueryBuilder query)
type
- The child type.query
- The query.public static TermsQueryBuilder termsQuery(java.lang.String name, java.lang.String... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, int... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, long... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, float... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, double... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder termsQuery(java.lang.String name, java.lang.Object... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, java.lang.String... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, int... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, long... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, float... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, double... values)
name
- The field namevalues
- The termspublic static TermsQueryBuilder inQuery(java.lang.String name, java.lang.Object... values)
name
- The field namevalues
- The termspublic static PrefixFilterBuilder inQuery(java.lang.String name, java.lang.String prefix)
name
- The field nameprefix
- The prefix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |