ElasticGraph Query API: Available Filter Predicates
ElasticGraph offers a variety of filtering predicates:
allOf
- Matches records where all of the provided sub-filters evaluate to true.
This works just like an
AND
operator in SQL.Note: multiple filters are automatically ANDed together. This is only needed when you have multiple filters that can’t be provided on a single filter input because of collisions between key names. For example, if you want to provide multiple
anySatisfy: ...
filters, you could doallOf: [{anySatisfy: ...}, {anySatisfy: ...}]
.Will be ignored when
null
or an empty list is passed. anyOf
- Matches records where any of the provided sub-filters evaluate to true.
This works just like an
OR
operator in SQL.Will be ignored when
null
is passed. When an empty list is passed, will cause this part of the filter to match no documents. anySatisfy
- Matches records where any of the list elements match the provided sub-filter.
Will be ignored when
null
or an empty object is passed. count
- Used to filter on the number of non-null elements in this list field.
Will be ignored when
null
or an empty object is passed. equalToAnyOf
- Matches records where the field value is equal to any of the provided values.
This works just like an
IN
operator in SQL.Will be ignored when
null
is passed. When an empty list is passed, will cause this part of the filter to match no documents. Whennull
is passed in the list, will match records where the field value isnull
. gt
- Matches records where the field value is greater than (>) the provided value.
Will be ignored when
null
is passed. gte
- Matches records where the field value is greater than or equal to (>=) the provided value.
Will be ignored when
null
is passed. lt
- Matches records where the field value is less than (<) the provided value.
Will be ignored when
null
is passed. lte
- Matches records where the field value is less than or equal to (<=) the provided value.
Will be ignored when
null
is passed. matchesPhrase
- Matches records where the field value has a phrase matching the provided phrase using
full text search. This is stricter than
matchesQuery
: all terms must match and be in the same order as the provided phrase.Will be ignored when
null
is passed. matchesQuery
- Matches records where the field value matches the provided query using full text search.
This is more lenient than
matchesPhrase
: the order of terms is ignored, and, by default, only one search term is required to be in the field value.Will be ignored when
null
is passed. near
- Matches records where the field’s geographic location is within a specified distance
from the location identified by
latitude
andlongitude
.Will be ignored when
null
or an empty object is passed. not
- Matches records where the provided sub-filter evaluates to false.
This works just like a
NOT
operator in SQL.Will be ignored when
null
or an empty object is passed. timeOfDay
- Matches records based on the time-of-day of the DateTime values.
Will be ignored when
null
of an empty object is passed.