Elastic Elasticsearch Reader/Writer

Licensing options for this format begin with FME Professional Edition.

Overview

FME provides read and write access to indexes on Elasticsearch clusters. FME treats each type in a Elasticsearch index as a feature type. Each document of a type is treated as a feature, and each field in a document is treated as an attribute.

Elasticsearch is an open source full-text search index. Elasticsearch indexes are JSON document stores that supports LonLat or GeoJSON geometry.

More information about Elasticsearch can be found at www.elastic.co.

Format Usage Notes

  • There are two types of Elasticsearch geometry fields: geo_point and geo_shape. geo_point fields can only contain point geometries, while geo_shape fields can contain any geometry that is representable as GeoJSON.
  • Writer: If a non-point geometry is written to a geo_point geometry field, then the geometry will be converted to its centroid point before writing.
  • Writer: Each Elasticsearch document has a unique Document ID. This ID can be specified on a feature with an attribute selected in the Writer Feature Type Parameters. If a document with that ID already exists, then the translation will fail.

Reader Overview

The Elasticsearch reader supports reading multiple types from the same Elasticsearch index. Because of this, a separate reader must be created for each Elasticsearch index.

The types must be defined in the workspace before they can be read.

Multiple Geometry

The Elasticsearch reader supports reading multiple geometry fields from the same Elasticsearch type. If there is more than one geometry field in the type mapping, then geometry will be read as FME Multiple Geometry. Each geometry part will be named after the corresponding Elasticsearch geometry field.

Writer Overview

The Elasticsearch writer stores documents into a type associated with a Elasticsearch index. The Elasticsearch writer provides the following capabilities:

Type Creation

The Elasticsearch writer uses the information within the FME workspace to automatically create Elasticsearch types as required. A type will be created when the first input feature is processed. If no features are sent to a feature type, then the corresponding type will not be created.

Overwrite Index

If the Overwrite Index parameter for the writer is set to Yes, then the writer will drop and re-create the index before writing any features to it.

Indices will be overwritten when the first input feature is processed. If no features are sent to any of the writer’s feature types, then the corresponding index will not be overwritten.

Multiple Geometry

The Elasticsearch reader supports writing to multiple geometry fields in the same Elasticsearch type.

If there is more than one geometry field in the existing type mapping, then a feature's geometry must have the same name as destination Elasticsearch geometry field. Otherwise, no geometry will be written.

If a feature's FME Multiple Geometry has multiple parts, then each part can be written to a different Elasticsearch geometry field. Each part will be written to the Elasticsearch geometry field corresponding to its geometry part name, provided that the field exists.

Nested geometry fields can be created and/or written to by naming the geometry in the form:

<outer_name>.<inner_name>

For example, a geo_point geometry field called address.location would result in data similar to the following:

{

“address”: {

“location”: [ <lon>, <lat> ]

}

}

FME Knowledge Center

Search Elasticsearch