exlasticsearch v1.10.1 ExlasticSearch.Query View Source
Elasticsearch query building functions. Basic usage for queryable Queryable is something like:
Queryable.search_query()
|> must(math(field, value))
|> should(match_phrash(field, value, opts))
|> filter(term(filter_field, value))
|> realize()
An ES query has 3 main clauses, must, should and filter. Must and should are near equivalents except that must clauses will reject records that fail to match. Filters require matches but do not contribute to scoring, while must/should both do. Nesting queries within queries is also supported
Currently the module only supports the boolean style of compound query, but we could add support for the others as need be.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html for documentation on specific query types.
Link to this section Summary
Functions
Appends a new filter scope to the running query
ids query clause
Builds a match query clause
Builds a match phrase query clause
Multimatch query clause
Appends a new must scope to the runnning query
Appends a new must_not scope to the running query
Add options to the current bool compound query (for instance the minimum number of accepted matches)
Query string query type, that applies ES standard query rewriting
range query clause
Converts a Query
struct into an ES compliant bool or function score compound query
Converts a query to a function score query and adds the given script
for scoring
Appends a new should scope to the running query
Adds a sort clause to the ES query
Term query clause
terms query clause
Link to this section Types
Link to this section Functions
Appends a new filter scope to the running query
ids query clause
Builds a match query clause
Builds a match phrase query clause
Multimatch query clause
Appends a new must scope to the runnning query
Appends a new must_not scope to the running query
Add options to the current bool compound query (for instance the minimum number of accepted matches)
Query string query type, that applies ES standard query rewriting
range query clause
Converts a Query
struct into an ES compliant bool or function score compound query
Converts a query to a function score query and adds the given script
for scoring
Appends a new should scope to the running query
Adds a sort clause to the ES query
Term query clause
terms query clause