|
|
@ -1,5 +1,9 @@ |
|
|
# ElasticSearch Index |
|
|
# ElasticSearch Index |
|
|
|
|
|
|
|
|
|
|
|
author: Jael |
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
## Description |
|
|
## Description |
|
|
|
|
|
|
|
|
The index operator index the given documents in ElasticSearch to get ready for retrieval. |
|
|
The index operator index the given documents in ElasticSearch to get ready for retrieval. |
|
|
@ -7,6 +11,8 @@ It accepts a single document in dictionary or a list of documents (dictionaries) |
|
|
For each document, the index automatically generates a unique id. |
|
|
For each document, the index automatically generates a unique id. |
|
|
To use this operator, you need to [set up ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html) in advance. |
|
|
To use this operator, you need to [set up ElasticSearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup.html) in advance. |
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
## Code Example |
|
|
## Code Example |
|
|
|
|
|
|
|
|
Insert an example document into ElasticSearch with address of localhost:9200 and index of 'test_index'. |
|
|
Insert an example document into ElasticSearch with address of localhost:9200 and index of 'test_index'. |
|
|
@ -35,3 +41,36 @@ res = es_insert(example_doc) # OR: es_insert([example_doc]) |
|
|
DataCollection(res).show() # Optional: display output data |
|
|
DataCollection(res).show() # Optional: display output data |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
|
|
|
|
## Factory Constructor |
|
|
|
|
|
|
|
|
|
|
|
Create the operator via the following factory method: |
|
|
|
|
|
|
|
|
|
|
|
***elasticsearch.search(host='localhost', port=9200, index_name='test_index', user=None, password=None, ca_certs=None)*** |
|
|
|
|
|
|
|
|
|
|
|
**Parameters:** |
|
|
|
|
|
|
|
|
|
|
|
***host***: *str* |
|
|
|
|
|
|
|
|
|
|
|
The host to connect ElasticSearch client. |
|
|
|
|
|
|
|
|
|
|
|
***port***: *int* |
|
|
|
|
|
|
|
|
|
|
|
The port to connect ElasticSearch client. |
|
|
|
|
|
|
|
|
|
|
|
***user***: *str* |
|
|
|
|
|
|
|
|
|
|
|
The username to connect ElasticSearch client if needed, defaults to None. |
|
|
|
|
|
|
|
|
|
|
|
***password***: *str* |
|
|
|
|
|
|
|
|
|
|
|
The user password to connect ElasticSearch client if needed, defaults to None. |
|
|
|
|
|
|
|
|
|
|
|
***ca_certs***: *str* |
|
|
|
|
|
|
|
|
|
|
|
The path to CA certificates to connect ElasticSearch client if needed, defaults to None. |
|
|
|
|
|
|
|
|
|
|
|
**Returns:** |
|
|
|
|
|
|
|
|
|
|
|
Index response wrapped by `elastic_transport.ObjectApiResponse`. |