Skip to main content

GetElasticsearch

Description

Elasticsearch get processor that uses the official Elastic REST client libraries to fetch a single document from Elasticsearch by _id. Note that the full body of the document will be read into memory before being written to a FlowFile for transfer.

Tags

elasticsearch, elasticsearch5, elasticsearch6, elasticsearch7, elasticsearch8, index, json, put, record

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Document Id *get-es-idThe _id of the document to retrieve.

Supports Expression Language, using FlowFile attributes and Environment variables.
Index *el-rest-fetch-indexThe name of the index to use.

Supports Expression Language, using FlowFile attributes and Environment variables.
Typeel-rest-typeThe type of this document (used by Elasticsearch for indexing and searching).

Supports Expression Language, using FlowFile attributes and Environment variables.
Destination *get-es-destinationFlowFile Content
  • FlowFile Content
  • FlowFile Attribute
Indicates whether the retrieved document is written to the FlowFile content or a FlowFile attribute.
Attribute Name *get-es-attribute-nameelasticsearch.docThe name of the FlowFile attribute to use for the retrieved document output.

Supports Expression Language, using FlowFile attributes and Environment variables.

This property is only considered if:
  • the property Destination has a value of flowfile-attribute
Client Service *el-rest-client-serviceController Service:
ElasticSearchClientService

Implementations:
ElasticSearchClientServiceImpl
An Elasticsearch client service to use for running queries.

Dynamic Properties

NameValueDescription
The name of a URL query parameter to addThe value of the URL query parameterAdds the specified property name/value as a query parameter in the Elasticsearch URL used for processing.

Supports Expression Language: Yes, evaluated using FlowFile Attributes and Environment variables.

Relationships

NameDescription
documentFetched documents are routed to this relationship.
failureAll flowfiles that fail for reasons unrelated to server availability go to this relationship.
not_foundA FlowFile is routed to this relationship if the specified document does not exist in the Elasticsearch cluster.
retryAll flowfiles that fail due to server/cluster availability go to this relationship.

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
elasticsearch.get.errorThe error message provided by Elasticsearch if there is an error fetching the document.
elasticsearch.indexThe Elasticsearch index containing the document
elasticsearch.typeThe Elasticsearch document type
filenameThe filename attribute is set to the document identifier

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component allows an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

JsonQueryElasticsearch