For Dashboard Designers Reference ElasticsearchQuery
Friday, November 11, 2022 12:54 PMElasticsearchQuery
Label: :IA_Function
Property: type: ElasticsearchQuery
Inherits from: Function
The ElasticsearchQuery Function executes a query in Elasticsearch (if available).
Function parameters
Key | Description | Default value | Possible values |
---|---|---|---|
connectionString |
Connection string for Elasticsearch server (https://[username]:[password]@[host]:[port]/ ) |
||
query |
The inline.query part of an Elasticsearch Search Template request. |
Any structure from the Elasticsearch Query DSL | |
params |
The parameters and their values to fill into {{placeholders}} in the query. |
object | |
size |
The number of results to return. | number |
Note: The Search Template of ElasticSearch 5.x replaced the Template Query of earlier Elasticsearch versions. The ElasticsearchQuery Function can work with both, without any adaptation of parameters.
Outgoing triggers
Type: success
Occurrence: When the user clicks an event.
Additional event properties (besides the inherited properties):
Key | Description | Possible values | |
---|---|---|---|
elasticsearch |
The raw Elasticsearch results from the Search API | object | |
processed |
Corresponding Neo4j nodes and relations retrieved from the Elasticsearch result. | object | |
processed.nodes |
Neo4j nodes | Array | |
processed.relations |
Neo4j relations | Array | |
meta.store |
Elasticsearch store the query was run on | string | |
meta.neo4jStore |
Neo4j store the nodes and relations were retrieved from. | string |
Example: simple full-text search
Consider the following ElasticsearchQuery:
{
"$query.query_string.query": "{{myPlaceholder}}",
"$size": "40",
"name": "Quick Search",
}
The query
parameter implements a very simple Query String, allowing intuitive fulltext search.
In order to execute the query this AND that OR thus
, the Trigger to the ElasticsearchQuery should fill in the search
parameter for the template:
{
"$params.myPlaceholder": "this AND that OR thus"
}