Elastic Elasticsearch Reader Parameters
Cluster Connection
Server
This parameter must contain the hostname or IP address of the Elasticsearch server. For example:
localhost or http://127.0.0.1
A port number can be specified by appending it to the end of the hostname in the form <hostname>:<port>. For example:
my.es.server:12345
If left unspecified, port 9200 will be used.
Constraints
The reader can fetch a list of indices from the Elasticsearch cluster.
After you have specified the cluster connection, click the Browse button to select indices for import. A connection window appears while the system compiles a table from the server.
Once the list appears, you can select one or more indices, and then click OK to dismiss the window. The index name(s) will appear in the Indices parameter.
JSON Attribute Handling
The parameter controls how the reader creates attributes from JSON document fields:
- All Levels (default): The reader flattens all fields in the document as separate attributes. Fields within an object are treated as attributes with a ‘.’ in the attribute name. Fields within an array are treated as list attributes.
- One Level: The reader treats both object and array fields as string attributes.
- One Level – Expand Arrays: The reader treats object fields as string attributes. Array fields at the top level of the JSON document are treated as list attributes.
{
“a”: 1,
“object”: {
“b”: 2,
“c”: 3
},
“array”: [
{
“d”: 4
},
5
]
}
If flattening mode is All Levels, then the feature attributes would be:
- a : 1
- object.b : 2
- object.c : 3
- array{0}.d : 4
- array{1} : 5
If flattening mode is One Level – Expand Arrays:
- a : 1
- object : { “b”: 2, “c”: 3 }
- array{0} : { “d”: 4 }
- array{1} : 5
If flattening mode is One Level:
- a : 1
- object : { “b”: 2, “c”: 3 }
- array : [ { “d”: 4 }, 5 ]
The parameter controls whether the Elasticsearch reader outputs the original JSON for each document in the source database(s).
Yes – The JSON will be read into the elasticsearch_json format attribute on each source feature.
No (default) – The original JSON will be stored on the feature.
Advanced
This parameter specifies the number of features to be retrieved from the server for each request.
If not specified, a default value of 100 is used.
Schema Attributes
Use this parameter to expose Format Attributes in FME Workbench when you create a workspace:
- In a dynamic scenario, it means these attributes can be passed to the output dataset at runtime.
- In a non-dynamic scenario, this parameter allows you to expose additional attributes on multiple feature types. Click the browse button to view the available format attributes (which are different for each format) for the reader.