public abstract class FilterBuilders extends Object
Modifier and Type | Method and Description |
---|---|
static AndFilterBuilder |
andFilter(FilterBuilder... filters) |
static BoolFilterBuilder |
boolFilter() |
static BytesFilterBuilder |
bytesFilter(BytesReference source)
Constructs a bytes filter to generate a filter from a
BytesReference source |
static ExistsFilterBuilder |
existsFilter(String name)
A filter to filter only documents where a field exists in them.
|
static GeoBoundingBoxFilterBuilder |
geoBoundingBoxFilter(String name)
A filter to filter based on a bounding box defined by top left and bottom right locations / points
|
static GeoShapeFilterBuilder |
geoDisjointFilter(String name,
ShapeBuilder shape)
A filter to filter indexed shapes that are not intersection with the query shape
|
static GeoShapeFilterBuilder |
geoDisjointFilter(String name,
String indexedShapeId,
String indexedShapeType) |
static GeoDistanceFilterBuilder |
geoDistanceFilter(String name)
A filter to filter based on a specific distance from a specific geo location / point.
|
static GeoDistanceRangeFilterBuilder |
geoDistanceRangeFilter(String name)
A filter to filter based on a specific range from a specific geo location / point.
|
static GeohashCellFilter.Builder |
geoHashCellFilter(String name)
A filter based on a bounding box defined by geohash.
|
static GeohashCellFilter.Builder |
geoHashCellFilter(String name,
GeoPoint point)
A filter based on a bounding box defined by geohash.
|
static GeohashCellFilter.Builder |
geoHashCellFilter(String name,
String geohash)
A filter based on a bounding box defined by geohash.
|
static GeohashCellFilter.Builder |
geoHashCellFilter(String name,
String geohash,
boolean neighbors)
A filter based on a bounding box defined by geohash.
|
static GeoShapeFilterBuilder |
geoIntersectionFilter(String name,
ShapeBuilder shape)
A filter to filter indexed shapes intersecting with shapes
|
static GeoShapeFilterBuilder |
geoIntersectionFilter(String name,
String indexedShapeId,
String indexedShapeType) |
static GeoPolygonFilterBuilder |
geoPolygonFilter(String name)
A filter to filter based on a polygon defined by a set of locations / points.
|
static GeoShapeFilterBuilder |
geoShapeFilter(String name,
ShapeBuilder shape,
ShapeRelation relation)
A filter based on the relationship of a shape and indexed shapes
|
static GeoShapeFilterBuilder |
geoShapeFilter(String name,
String indexedShapeId,
String indexedShapeType,
ShapeRelation relation) |
static GeoShapeFilterBuilder |
geoWithinFilter(String name,
ShapeBuilder shape)
A filter to filter indexed shapes that are contained by a shape
|
static GeoShapeFilterBuilder |
geoWithinFilter(String name,
String indexedShapeId,
String indexedShapeType) |
static HasChildFilterBuilder |
hasChildFilter(String type,
FilterBuilder filter)
Constructs a child filter, with the child type and the filter to run against child documents, with
the result of the filter being the *parent* documents.
|
static HasChildFilterBuilder |
hasChildFilter(String type,
QueryBuilder query)
Constructs a child filter, with the child type and the query to run against child documents, with
the result of the filter being the *parent* documents.
|
static HasParentFilterBuilder |
hasParentFilter(String parentType,
FilterBuilder filter)
Constructs a parent filter, with the parent type and the filter to run against parent documents, with
the result of the filter being the *child* documents.
|
static HasParentFilterBuilder |
hasParentFilter(String parentType,
QueryBuilder query)
Constructs a parent filter, with the parent type and the query to run against parent documents, with
the result of the filter being the *child* documents.
|
static IdsFilterBuilder |
idsFilter(String... types)
Creates a new ids filter with the provided doc/mapping types.
|
static IndicesFilterBuilder |
indicesFilter(FilterBuilder filter,
String... indices) |
static TermsFilterBuilder |
inFilter(String name,
double... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
inFilter(String name,
float... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
inFilter(String name,
int... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
inFilter(String name,
long... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
inFilter(String name,
Object... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
inFilter(String name,
String... values)
A filer for a field based on several terms matching on any of them.
|
static LimitFilterBuilder |
limitFilter(int limit)
A filter that limits the results to the provided limit value (per shard!).
|
static MatchAllFilterBuilder |
matchAllFilter()
A filter that matches all documents.
|
static MissingFilterBuilder |
missingFilter(String name)
A filter to filter only documents where a field does not exists in them.
|
static NestedFilterBuilder |
nestedFilter(String path,
FilterBuilder filter) |
static NestedFilterBuilder |
nestedFilter(String path,
QueryBuilder query) |
static NotFilterBuilder |
notFilter(FilterBuilder filter) |
static NumericRangeFilterBuilder |
numericRangeFilter(String name)
Deprecated.
The numeric_range filter will be removed at some point in time in favor for the range filter with
the execution mode
fielddata . |
static OrFilterBuilder |
orFilter(FilterBuilder... filters) |
static PrefixFilterBuilder |
prefixFilter(String name,
String prefix)
A filter that restricts search results to values that have a matching prefix in a given
field.
|
static QueryFilterBuilder |
queryFilter(QueryBuilder queryBuilder)
A filter that simply wraps a query.
|
static RangeFilterBuilder |
rangeFilter(String name)
A filter that restricts search results to values that are within the given range.
|
static RegexpFilterBuilder |
regexpFilter(String name,
String regexp)
A filter that restricts search results to field values that match a given regular expression.
|
static ScriptFilterBuilder |
scriptFilter(String script)
A builder for filter based on a script.
|
static TermFilterBuilder |
termFilter(String name,
double value)
A filter for a field based on a term.
|
static TermFilterBuilder |
termFilter(String name,
float value)
A filter for a field based on a term.
|
static TermFilterBuilder |
termFilter(String name,
int value)
A filter for a field based on a term.
|
static TermFilterBuilder |
termFilter(String name,
long value)
A filter for a field based on a term.
|
static TermFilterBuilder |
termFilter(String name,
Object value)
A filter for a field based on a term.
|
static TermFilterBuilder |
termFilter(String name,
String value)
A filter for a field based on a term.
|
static TermsFilterBuilder |
termsFilter(String name,
double... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
float... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
int... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
Iterable<?> values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
long... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
Object... values)
A filer for a field based on several terms matching on any of them.
|
static TermsFilterBuilder |
termsFilter(String name,
String... values)
A filer for a field based on several terms matching on any of them.
|
static TermsLookupFilterBuilder |
termsLookupFilter(String name)
A terms lookup filter for the provided field name.
|
static TypeFilterBuilder |
typeFilter(String type)
A filter based on doc/mapping type.
|
static WrapperFilterBuilder |
wrapperFilter(byte[] data,
int offset,
int length) |
static WrapperFilterBuilder |
wrapperFilter(String filter) |
public static MatchAllFilterBuilder matchAllFilter()
public static LimitFilterBuilder limitFilter(int limit)
public static NestedFilterBuilder nestedFilter(String path, QueryBuilder query)
public static NestedFilterBuilder nestedFilter(String path, FilterBuilder filter)
public static IdsFilterBuilder idsFilter(@Nullable String... types)
types
- The types to match the ids against.public static TypeFilterBuilder typeFilter(String type)
public static TermFilterBuilder termFilter(String name, String value)
name
- The field namevalue
- The term valuepublic static TermFilterBuilder termFilter(String name, int value)
name
- The field namevalue
- The term valuepublic static TermFilterBuilder termFilter(String name, long value)
name
- The field namevalue
- The term valuepublic static TermFilterBuilder termFilter(String name, float value)
name
- The field namevalue
- The term valuepublic static TermFilterBuilder termFilter(String name, double value)
name
- The field namevalue
- The term valuepublic static TermFilterBuilder termFilter(String name, Object value)
name
- The field namevalue
- The term valuepublic static TermsFilterBuilder termsFilter(String name, String... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, int... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, long... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, float... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, double... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, Object... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder termsFilter(String name, Iterable<?> values)
name
- The field namevalues
- The termspublic static TermsLookupFilterBuilder termsLookupFilter(String name)
public static TermsFilterBuilder inFilter(String name, String... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder inFilter(String name, int... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder inFilter(String name, long... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder inFilter(String name, float... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder inFilter(String name, double... values)
name
- The field namevalues
- The termspublic static TermsFilterBuilder inFilter(String name, Object... values)
name
- The field namevalues
- The termspublic static PrefixFilterBuilder prefixFilter(String name, String prefix)
name
- The field nameprefix
- The prefixpublic static RegexpFilterBuilder regexpFilter(String name, String regexp)
name
- The field nameregexp
- The regular expressionpublic static RangeFilterBuilder rangeFilter(String name)
name
- The field name@Deprecated public static NumericRangeFilterBuilder numericRangeFilter(String name)
fielddata
.name
- The field namepublic static QueryFilterBuilder queryFilter(QueryBuilder queryBuilder)
queryBuilder
- The query to wrap as a filterpublic static ScriptFilterBuilder scriptFilter(String script)
script
- The script to filter by.public static GeoDistanceFilterBuilder geoDistanceFilter(String name)
name
- The location field name.public static GeoDistanceRangeFilterBuilder geoDistanceRangeFilter(String name)
name
- The location field name.public static GeoBoundingBoxFilterBuilder geoBoundingBoxFilter(String name)
name
- The location field name.public static GeohashCellFilter.Builder geoHashCellFilter(String name)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field name.public static GeohashCellFilter.Builder geoHashCellFilter(String name, String geohash)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field name.geohash
- The Geohash to filterpublic static GeohashCellFilter.Builder geoHashCellFilter(String name, GeoPoint point)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field name.point
- a geo point within the geohash bucketpublic static GeohashCellFilter.Builder geoHashCellFilter(String name, String geohash, boolean neighbors)
{"type":"geo_point", "geohash":true}
to work.name
- The geo point field namegeohash
- The Geohash to filterneighbors
- should the neighbor cell also be filteredpublic static GeoPolygonFilterBuilder geoPolygonFilter(String name)
name
- The location field name.public static GeoShapeFilterBuilder geoShapeFilter(String name, ShapeBuilder shape, ShapeRelation relation)
name
- The shape field nameshape
- Shape to use in the filterrelation
- relation of the shapespublic static GeoShapeFilterBuilder geoShapeFilter(String name, String indexedShapeId, String indexedShapeType, ShapeRelation relation)
public static GeoShapeFilterBuilder geoIntersectionFilter(String name, ShapeBuilder shape)
name
- The shape field nameshape
- Shape to use in the filterpublic static GeoShapeFilterBuilder geoIntersectionFilter(String name, String indexedShapeId, String indexedShapeType)
public static GeoShapeFilterBuilder geoWithinFilter(String name, ShapeBuilder shape)
name
- The shape field nameshape
- Shape to use in the filterpublic static GeoShapeFilterBuilder geoWithinFilter(String name, String indexedShapeId, String indexedShapeType)
public static GeoShapeFilterBuilder geoDisjointFilter(String name, ShapeBuilder shape)
name
- The shape field nameshape
- Shape to use in the filterpublic static GeoShapeFilterBuilder geoDisjointFilter(String name, String indexedShapeId, String indexedShapeType)
public static ExistsFilterBuilder existsFilter(String name)
name
- The name of the fieldpublic static MissingFilterBuilder missingFilter(String name)
name
- The name of the fieldpublic static HasChildFilterBuilder hasChildFilter(String type, QueryBuilder query)
type
- The child typequery
- The query to run against the child typepublic static HasChildFilterBuilder hasChildFilter(String type, FilterBuilder filter)
type
- The child typefilter
- The query to run against the child typepublic static HasParentFilterBuilder hasParentFilter(String parentType, QueryBuilder query)
parentType
- The parent typequery
- The query to run against the parent typepublic static HasParentFilterBuilder hasParentFilter(String parentType, FilterBuilder filter)
parentType
- The parent typefilter
- The filter to run against the parent typepublic static BoolFilterBuilder boolFilter()
public static AndFilterBuilder andFilter(FilterBuilder... filters)
public static OrFilterBuilder orFilter(FilterBuilder... filters)
public static NotFilterBuilder notFilter(FilterBuilder filter)
public static IndicesFilterBuilder indicesFilter(FilterBuilder filter, String... indices)
public static WrapperFilterBuilder wrapperFilter(String filter)
public static WrapperFilterBuilder wrapperFilter(byte[] data, int offset, int length)
public static BytesFilterBuilder bytesFilter(BytesReference source)
BytesReference
sourcesource
- The filter sourceCopyright © 2009–2015. All rights reserved.