Elasticsearch Queries

These queries are converted to Elasticsearch search parameters and aggregations by ElasticQueryProducer.

These queries support simple, aggregation, command and bundle query types.

Elasticsearch specific features for special use cases are as follows:

Query Parameters

Parameter
Definition

global

Whether the query is a global aggregation or not

Order Field Parameters

Parameter
Definition

sorter

Type of sorter to use (field for sort by field name, script for sort by script evaluation)

Condition Parameters

Parameter
Definition

boost

Boost factor for condition priority in search scores

queryName

Name to use for condition

caseInsensitive

(For EQ & CONTAINS simple conditions) whether check should be case sensitive or not

score

(For AND & CUSTOM complex conditions) whether inner conditions should be scored (must) or not (filter)

scoreMode

(For array conditions) score mode to apply on nested query

innerHit

(For array conditions) inner hit statement for nested query

innerHit.inject

Whether "innerhit" parameter should be injected with variables

General Parameters

For queries, order fields, custom aggregation fields and custom conditions, it is possible to pass Elasticsearch specific statements, using following parameters:

Parameter
Definition

elastic

Json object to be used as the field expression

elastic.inject

Whether "elastic" parameter should be injected with variables

elasticJson

Json string to be used as the field expression

elasticJson.inject

Whether "elasticJson" parameter should be injected with variables

Custom Condition Operators

For simple conditions, Elasticsearch supports following custom operators:

  • query_string: Using "elastic", "elasticSearch" parameters or the command value, creates a query_string type query

  • simple_query_string: Using "elastic", "elasticSearch" parameters or the command value, creates a simple_query_string type query

  • match: Using "elastic", "elasticSearch" parameters or the command & values, creates a match type query

  • multi_match: Using "elastic", "elasticSearch" parameters or the command & values, creates a multi_match type query

  • prefix: Using "elastic", "elasticSearch" parameters or the command & values, creates a prefix type query

  • terms_set: Using "elastic", "elasticSearch" parameters or the command & values, creates a terms_set type query. When command is used, "data.required_matches" field is used as the "minimum should match" field.

  • more_like_this: Using "elastic", "elasticSearch" parameters or the command & values, creates a more_like_this type query. When command is used, minimum term frequency and document frequency are both set to 1.

  • script: Using "elastic", "elasticSearch" parameters or the command, creates a script type query

  • generic: Using "elastic", "elasticSearch" parameters, creates a query, based on "type" condition parameter

Last updated