|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.elasticsearch.index.query.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 BoostingQueryBuilder |
boostingQuery()
The BoostingQuery class can be used to effectively demote results that match a given query. |
static ConstantScoreQueryBuilder |
constantScoreQuery(FilterBuilder 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(QueryBuilder queryBuilder)
A query that simply applies the boost fact to the wrapped query (multiplies it). |
static CustomFiltersScoreQueryBuilder |
customFiltersScoreQuery(QueryBuilder queryBuilder)
|
static CustomScoreQueryBuilder |
customScoreQuery(QueryBuilder 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(SpanQueryBuilder 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(QueryBuilder queryBuilder,
FilterBuilder filterBuilder)
Deprecated. Use filteredQuery instead (rename) |
static FilteredQueryBuilder |
filteredQuery(QueryBuilder queryBuilder,
FilterBuilder 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,
QueryBuilder query)
Constructs a new NON scoring child query, with the child type and the query to run on the child documents. |
static IdsQueryBuilder |
idsQuery(java.lang.String... types)
Constructs a query that will match only specific ids within types. |
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 NestedQueryBuilder |
nestedQuery(java.lang.String path,
FilterBuilder filter)
|
static NestedQueryBuilder |
nestedQuery(java.lang.String path,
QueryBuilder query)
|
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(SpanQueryBuilder 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 TextQueryBuilder |
text(java.lang.String name,
java.lang.Object text)
Deprecated. use textQuery(String, Object) instead |
static TextQueryBuilder |
textPhrase(java.lang.String name,
java.lang.Object text)
Deprecated. use textPhraseQuery(String, Object) instead |
static TextQueryBuilder |
textPhrasePrefix(java.lang.String name,
java.lang.Object text)
Deprecated. use textPhrasePrefixQuery(String, Object) instead |
static TextQueryBuilder |
textPhrasePrefixQuery(java.lang.String name,
java.lang.Object text)
Creates a text query with type "PHRASE_PREFIX" for the provided field name and text. |
static TextQueryBuilder |
textPhraseQuery(java.lang.String name,
java.lang.Object text)
Creates a text query with type "PHRASE" for the provided field name and text. |
static TextQueryBuilder |
textQuery(java.lang.String name,
java.lang.Object text)
Creates a text query with type "BOOLEAN" for the provided field name and text. |
static TopChildrenQueryBuilder |
topChildrenQuery(java.lang.String type,
QueryBuilder 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. |
static WrapperQueryBuilder |
wrapperQuery(byte[] source,
int offset,
int length)
A Query builder which allows building a query thanks to a JSON string or binary data. |
static WrapperQueryBuilder |
wrapperQuery(java.lang.String source)
A Query builder which allows building a query thanks to a JSON string or binary data. |
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 TextQueryBuilder text(java.lang.String name, java.lang.Object text)
textQuery(String, Object)
instead
name
- The field name.text
- The query text (to be analyzed).public static TextQueryBuilder textQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static TextQueryBuilder textPhrase(java.lang.String name, java.lang.Object text)
textPhraseQuery(String, Object)
instead
name
- The field name.text
- The query text (to be analyzed).public static TextQueryBuilder textPhraseQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static TextQueryBuilder textPhrasePrefix(java.lang.String name, java.lang.Object text)
textPhrasePrefixQuery(String, Object)
instead
name
- The field name.text
- The query text (to be analyzed).public static TextQueryBuilder textPhrasePrefixQuery(java.lang.String name, java.lang.Object text)
name
- The field name.text
- The query text (to be analyzed).public static DisMaxQueryBuilder disMaxQuery()
public static IdsQueryBuilder idsQuery(@Nullable java.lang.String... types)
types
- The mapping/doc typepublic 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 BoostingQueryBuilder boostingQuery()
public 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(SpanQueryBuilder match, int end)
public static SpanNearQueryBuilder spanNearQuery()
public static SpanNotQueryBuilder spanNotQuery()
public static SpanOrQueryBuilder spanOrQuery()
public static FieldMaskingSpanQueryBuilder fieldMaskingSpanQuery(SpanQueryBuilder query, java.lang.String field)
public static FilteredQueryBuilder filtered(QueryBuilder queryBuilder, FilterBuilder filterBuilder)
queryBuilder
- The query to apply the filter tofilterBuilder
- The filter to apply on the querypublic static FilteredQueryBuilder filteredQuery(QueryBuilder queryBuilder, FilterBuilder filterBuilder)
queryBuilder
- The query to apply the filter tofilterBuilder
- The filter to apply on the querypublic static ConstantScoreQueryBuilder constantScoreQuery(FilterBuilder filterBuilder)
filterBuilder
- The filter to wrap in a constant score querypublic static CustomBoostFactorQueryBuilder customBoostFactorQuery(QueryBuilder queryBuilder)
queryBuilder
- The query to apply the boost factor to.public static CustomScoreQueryBuilder customScoreQuery(QueryBuilder queryBuilder)
queryBuilder
- The query to custom scorepublic static CustomFiltersScoreQueryBuilder customFiltersScoreQuery(QueryBuilder queryBuilder)
public 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, QueryBuilder query)
type
- The child type.query
- The query.public static HasChildQueryBuilder hasChildQuery(java.lang.String type, QueryBuilder query)
type
- The child type.query
- The query.public static NestedQueryBuilder nestedQuery(java.lang.String path, QueryBuilder query)
public static NestedQueryBuilder nestedQuery(java.lang.String path, FilterBuilder filter)
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 prefixpublic static WrapperQueryBuilder wrapperQuery(java.lang.String source)
public static WrapperQueryBuilder wrapperQuery(byte[] source, int offset, int length)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |