Elasticsearch Reader Parameters
Index Connection
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.
This parameter must contain the name of the index to be read.
After you have specified the server, click the Browse button to select an available index. A connection window appears while the system compiles a table from the server.
Once the index list appears, you can select one index, and then click OK to dismiss the window. The index name will appear in the Index field in the parameter box.
Constraints
The reader can fetch a list of types from the Elasticsearch index.
After you have specified the index connection, click the Browse button to select types for import. A connection window appears while the system compiles a table from the server.
Once the type list appears, you can select one or more types, and then click OK to dismiss the window. The type name(s) will appear in the Type List field in the parameter box.
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 – 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.
- One Level: The reader treats both object and array fields as string attributes.
Example:
{ “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).
If this parameter is set to Yes, then the JSON will be read into the elasticsearch_json format attribute on each source feature.
If this parameter is set to No (the 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 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, you can use this parameter to expose additional attributes on multiple feature types.