Elastic Search
Elasticsearch is an open-source distributed search and analytics engine built on top of Apache Lucene. It is designed to handle large volumes of data and provide real-time search and analysis capabilities. Elasticsearch offers a scalable and flexible solution for searching, indexing, and analyzing structured, unstructured, and semi-structured data. It provides powerful full-text search capabilities, and supports complex queries. Elasticsearch is commonly used in applications that require fast and accurate search functionality, such as e-commerce platforms, log analysis, monitoring systems, and data exploration.
ElasticSearch Integration
Description
<
elasticsearchIntegration>
- command for integration with elasticSearch
Required parameters:
- alias - unique name of the integration (e.g., "MY_ELASTICSEARCH")
- enabled – a boolean flag to enable/disable integration (can be “true” or “false”)
- host - specifies the hostname or IP address of the Elasticsearch server (e.g., "localhost")
- port - specifies the port number on which the Elasticsearch server is running (e.g., 9201)
- scheme - specifies the protocol scheme to be used for communication with Elasticsearch (e.g., "http")
- connectionTimeout - sets the maximum time, in milliseconds, for establishing a connection with Elasticsearch (e.g., 30000)
- socketTimeout - sets the maximum time, in milliseconds, for socket timeout during communication with Elasticsearch (e.g., 30000)
- signer - indicates whether request signing is enabled (true) or disabled (false)
- serviceName - specifies the name of the Elasticsearch service (e.g., "MY_SERVICE")
- region - specifies the AWS region for Elasticsearch (e.g., "us-west-2")
- username - specifies the username for authentication with Elasticsearch (e.g., "my_username")
- password - specifies the password for authentication with Elasticsearch (e.g., "my_password123")
<elasticsearchIntegration>
<elasticsearch alias="MY_ELASTICSEARCH" enabled="true">
<host>localhost</host>
<port>9201</port>
<scheme>http</scheme>
<connectionTimeout>30000</connectionTimeout>
<socketTimeout>30000</socketTimeout>
<signer>true</signer>
<serviceName>MY_SERVICE</serviceName>
<region>us-west-2</region>
<username>my_username</username>
<password>my_password123</password>
</elasticsearch>
</elasticsearchIntegration>
ElasticSearch Command
Description
<elasticsearch> – command which is responsible for sending the Elasticsearch queries in testing scenarios
Required parameters:
- comment
- alias - unique name of the integration
- method: post, get, put, delete, head (only one can be selected)
Methods parameters:
- endpoint - endpoint for your query
- response i. file - name of the expected file for the query ii. code - expected code of the query execution iii. header - expected header a. name - name of the header b. data - value for the header
- header і. name - the name of the header іі. data - value for the header
- param і. name - the name of the param іі. data - value for param
- body i. raw - raw with value for the body of the query ii. from file - name of the request file with value for the body of the query (only in JSON format) iii. param - represents a parameter within the request body iv. multipart - indicates that the request body will be in a multipart format, typically used for sending binary or multi-part data
Optional parameters:
- condition - condition according to which this test step will or won't be executed
- threshold - parameter, where the maximum execution time of the command is defined (milliseconds), if the execution time is exceeded, the step will be defined as failed
<elasticsearch comment="Execute elasticsearch command post" alias="MY_ELASTICSEARCH">
<post endpoint="/news/_doc/1">
<header name="content-type" data="application/json"/>
<response code="201" file="expected_2.json">
<header name="content-length" data="152"/>
</response>
<body>
<from file="request_2.json"/>
</body>
</post>
</elasticsearch>
If you need to get a document via HTTP, immediately after executing the Elasticsearch post/delete/put commands, we recommend write a wait of 1-3 seconds between requests so that the document is available