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:

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

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) 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 Idget-es-idThe _id of the document to retrieve.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Indexel-rest-fetch-indexThe name of the index to use.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Typeel-rest-typeThe type of this document (used by Elasticsearch for indexing and searching).
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Destinationget-es-destinationFlowFile Content
  • FlowFile Content Output the retrieved document as the FlowFile content.
  • FlowFile Attribute Output the retrieved document as a FlowFile attribute specified by the Attribute Name.
Indicates whether the retrieved document is written to the FlowFile content or a FlowFile attribute.
Attribute Nameget-es-attribute-nameelasticsearch.docThe name of the FlowFile attribute to use for the retrieved document output.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [Destination] Property has a value of "FlowFile Attribute".
Client Serviceel-rest-client-serviceController Service API:
ElasticSearchClientService
Implementation: ElasticSearchClientServiceImpl
An Elasticsearch client service to use for running queries.

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

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: true (will be evaluated using flow file attributes and variable registry)

Relationships:

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

Reads Attributes:

None specified.

Writes Attributes:

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

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:

None specified.

See Also:

JsonQueryElasticsearch