Elasticsearch

Elasticsearch is a search engine based on Lucene. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.

Integration with LogicHub

Connecting with Elasticsearch

To connect to Elasticsearch following details are required:

  • Server URL: Enter server URL for Elasticsearch.
  • Username: Enter Username for Elasticsearch.
  • Password: Enter Password for Elasticsearch.

Actions with Elasticsearch

Run Query v2

Runs the query on Elasticsearch service.

Inputs to this Action

  • Connection: Choose a connection that you have created.
  • Index Name: Select column that contains index name to run the ES query on.
  • Query Type: Select Query Type Basic/Advanced
  • Jinja Template for Query: Template of the elastic search query. Example:
    Basic Query
    title:"{{title_column}}" AND text:{{text_column}}
    Advanced Query
    {"query": { "multi_match" : { "query": "{{search_text}}", "fields": [ "subject", "message" ] }}}
  • Query Timeout (Optional): query timeout in seconds (default is 30 seconds).
  • Stored Fields (Optional): Select column that contains value for Stored Fields.
  • Records Size (Optional): Enter Size for Elastic search records. (default is 10).

Output of Action
Correlated result json containing the following items:

  • has_error: True/False
  • error: message/null
  • other keys of Elasticsearch Query Results

Insert Records

Inserts records in an Elasticsearch index.

Inputs to this Action

  • Connection: Choose a connection that you have created.
  • Select Index: Select column that contains the index name where the records are to be inserted
  • Jinja Template for Document: Enter jinja-templated document JSON. Example:
{
    "fname": "{{firstname_col}}",
    "lname": "{{lastname_col}}"
}
  • Batch Size (Optional): Enter a number of rows to process in one batch of the bulk insert. (Default is 100).

Output of Action
Correlated result JSON containing the following items:

  • has_error: True/False
  • error: message/null
  • other keys of insert response per document returned by Elasticsearch.

Did this page help you?