Skip to main content
Loading

Configure the Doc ID for Aerospike Connect for Elasticsearch

An optional doc-id section of the aerospike-elasticsearch-outbound.yaml file defines how to generate an Elasticsearch's document ID.

note

Aerospike lets Elasticsearch generate a doc-id by default.

This field has the following two properties:

PropertyRequiredDefaultDescription
sourceYesSource for generating Elasticsearch's doc-id value.
failure-strategyNoUSE_DIGESTWhat to do if Aerospike can’t generate the doc-id value using the specified source. While not all sources are compatible with this configuration parameter, you can still generate the doc-id value using those sources.

Source values​

The source field accepts the following values:

ValueDescriptionCan configure failure-strategy
noneThe destination system will auto-generate the value or use null.No
system-defaultThe connector sets a different default source. In this case, it is set to source none.No
namespaceUse the record’s namespace as Elasticsearch's doc-id value.No
setUse the record’s set name as Elasticsearch's doc-id value.Yes
digestUse the record’s digest as Elasticsearch's doc-id value.No
user-keyUse the record’s user-key as Elasticsearch's doc-id value.Yes
bin-valueUse the record’s bin value of the given bin name as Elasticsearch's doc-id value.Yes
staticUse a static value as Elasticsearch's doc-id value.No

Failure Strategy values​

While not all sources are compatible with this configuration parameter, you can still generate the doc-id value using those sources.

The failure-strategy field accepts the following values:

ValueDescriptionDetails
USE_DIGESTUse the record’s digest as Elasticsearch's doc-id value.This value is always available.
FAILSend the temporary error to XDR so that it will retry the record.
IGNORESend the permanent error to XDR so that it will not retry the record.In this situation, the record is never shipped to the destination system.

Examples​

You can use any of the failure-strategy values wherever applicable. The following examples show usage of all failure-strategy values at different places.

Source: none​

...
doc-id:
source: none
...

Source: system-default​

...
doc-id:
source: system-default
...

Source: namespace​

...
doc-id:
source: namespace
...

Source: set​

...
doc-id:
source: set
failure-strategy: USE_DIGEST
...

Source: digest​

...
doc-id:
source: digest
...

Source: user-key​

...
doc-id:
source: user-key
failure-strategy: FAIL
...

Source: bin-value​

...
doc-id:
source: bin-value
bin-name: color
failure-strategy: IGNORE
...

Source: static​

...
doc-id:
source: static
value: dummy_doc_id
...