View Source ExlasticSearch.Query (exlasticsearch v2.3.0)
Elasticsearch query building functions.
Basic usage for queryable Queryable is something like:
Queryable.search_query()
|> must(match(field, value))
|> should(match_phrase(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.
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 running 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.
Types
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 running 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.