Elasticsearch

The Elasticsearch component is a data component that allows users to access the Elasticsearch database. It can carry out the following tasks:

#Release Stage

Alpha

#Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

#Setup

In order to communicate with Elastic, the following connection details need to be provided. You may specify them directly in a pipeline recipe as key-value pairs within the component's setup block, or you can create a Connection from the Integration Settings page and reference the whole setup as setup: ${connection.<my-connection-id>}.

FieldField IDTypeNote
Cloud ID (required)cloud-idstringFill in the Cloud ID for the Elasticsearch instance.
API Key (required)api-keystringFill in the API key for the Elasticsearch instance (please use encoded one).

#Supported Tasks

Search for documents in Elasticsearch, support full text search

InputIDTypeDescription
Task ID (required)taskstringTASK_SEARCH
Index Name (required)index-namestringName of the Elasticsearch index.
IDidstringThe ID of the document.
QueryquerystringFull text search query for search task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.
FilterfilterobjectThe query dsl filter which starts with "query" field, please refer to here.
Filter SQLfilter-sqlstringThe filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.
SizesizeintegerNumber of documents to return. If empty then all documents will be returned.
Fieldsfieldsarray[string]The fields to return in the documents. If empty then all fields will be returned.
Minimum Scoremin-scorenumberMinimum score to consider for search results. If empty then no minimum score will be considered.
OutputIDTypeDescription
StatusstatusstringSearch operation status.
ResultresultobjectResult of the search operation.
Output Objects in Search

Result

FieldField IDTypeNote
DatadataarrayThe data returned from the search operation.
DocumentsdocumentsarrayThe documents returned from the search operation.
IDsidsarrayThe ids returned from the search operation.

Search for vector similarity search in Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_VECTOR_SEARCH
Index Name (required)index-namestringName of the Elasticsearch index.
Field (required)fieldstringField name of the vector to search for similar vectors.
Query Vectorquery-vectorarray[number]Query vector to search for similar vectors.
KkintegerK of documents to do kNN vector search.
Num Candidatesnum-candidatesintegerNumber of candidates to be considered for kNN vector search. Default to 2 times of k.
FilterfilterobjectThe query dsl filter which starts with "filter" field, please refer to here.
Filter SQLfilter-sqlstringThe filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.
Fieldsfieldsarray[string]The fields to return in the documents. If empty then all fields will be returned.
Minimum Scoremin-scorenumberMinimum score to consider for search results. If empty then no minimum score will be considered.
OutputIDTypeDescription
StatusstatusstringSearch operation status.
ResultresultobjectResult of the vector search operation.
Output Objects in Vector Search

Result

FieldField IDTypeNote
DocumentsdocumentsarrayThe documents returned from the vector search operation.
IDsidsarrayThe ids returned from the vector search operation.
MetadatametadataarrayThe metadata returned from the vector search operation.
VectorsvectorsarrayThe vectors returned from the vector search operation.

#Index

Index a document into Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_INDEX
Index Name (required)index-namestringName of the Elasticsearch index.
IDidstringThe ID of the document.
Data (required)dataobjectData to be indexed.
OutputIDTypeDescription
StatusstatusstringIndex operation status.

#Multi Index

Index multiple documents into Elasticsearch with bulk API

InputIDTypeDescription
Task ID (required)taskstringTASK_MULTI_INDEX
Index Name (required)index-namestringName of the Elasticsearch index.
Array IDarray-idarray[string]The array of id.
Array Data (required)array-dataarray[object]Array data to be indexed.
OutputIDTypeDescription
StatusstatusstringIndex operation status.

#Update

Update a document in Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_UPDATE
Index Name (required)index-namestringName of the Elasticsearch index.
IDidstringThe ID of the document.
QueryquerystringFull text search query for update task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.
FilterfilterobjectThe query dsl filter which starts with "query" field, please refer to here.
Filter SQLfilter-sqlstringThe filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.
Update (required)update-dataobjectUpdate data.
OutputIDTypeDescription
StatusstatusstringUpdate operation status.

#Delete

Delete documents from Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_DELETE
Index Name (required)index-namestringName of the Elasticsearch index.
IDidstringThe ID of the document.
QueryquerystringFull text search query for delete task, query will be prioritised over filter if both are provided, if both query and filter are not provided, all documents will be selected.
FilterfilterobjectThe query dsl filter which starts with "query" field, please refer to here.
Filter SQLfilter-sqlstringThe filter to be applied to the data with SQL syntax, which starts with WHERE clause, empty for no filter.
OutputIDTypeDescription
StatusstatusstringDelete operation status.

#Create Index

Create an index in Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_CREATE_INDEX
Index Name (required)index-namestringName of the Elasticsearch index.
MappingsmappingsobjectIndex mappings which starts with {"mappings":{"properties"}} field, please refer to here for vector search and here for other mappings.
OutputIDTypeDescription
StatusstatusstringCreate index operation status.

#Delete Index

Delete an index in Elasticsearch

InputIDTypeDescription
Task ID (required)taskstringTASK_DELETE_INDEX
Index Name (required)index-namestringName of the Elasticsearch index.
OutputIDTypeDescription
StatusstatusstringDelete index operation status.