5.2.3. Optional Configuration Parameters for Elasticsearch

A number of optional, configurable, properties are available that control how Tungsten Replicator applies and populates information when the data is written into Elasticsearch. The following properties can by set during configuration using --property=PROPERTYNAME=value:

Table 5.1. Optional Elasticsearch Applier Properties

OptionDescription
replicator.applier.dbms.docIdFormatDetermines the format of the document ID used to store the information with Elasticsearch
replicator.applier.dbms.embedCommitTimeSets whether the commit time for the source row is embedded into the document
replicator.applier.dbms.embedSchemaTableEmbed the source schema name and table name in the stored document
replicator.applier.dbms.ignoreDeleteErrorsWhether a failure to delete an entry should raise an error
replicator.applier.dbms.ignoreUpdateErrorsWhether a failure to update an existing entry should raise an error
replicator.applier.dbms.indexNameThe string to be used as the index name when the incoming schema name is not used
replicator.applier.dbms.selfGeneratedIdDetermines whether to use a self generated document id or one derived from the primary key information
replicator.applier.dbms.typeNameThe string to use as the index type name when the incoming table is not used
replicator.applier.dbms.useSchemaAsIndexSpecifies whether the incoming schema name for the data should be used as the Index Name
replicator.applier.dbms.useTableAsTypeSpecifies whether the incoming table name for the data should be used as the Index Type

replicator.applier.dbms.docIdFormat

Optionreplicator.applier.dbms.docIdFormat
DescriptionDetermines the format of the document ID used to store the information with Elasticsearch
Value Typestring
Defaultpkey
Valid ValuespkeyCombine the primary key column values into a single string
 pkeyusCombine the primary key column values into a single string joined by an underscore character
 tspkeyCombine the schema name, table name, and primary key column values into a single string joined by an underscore character
 tspkeyusCombine the schema name, table name, and primary key column values into a single string

Determines the format of the document ID used to store the information into Elasticsearch. For example, when configured to use tspkeyus, then the format of the document ID will consist of the schemaname, table name and primary key column information separated by underscores, SCHEMANAME_TABLENAME_234.

replicator.applier.dbms.embedCommitTime

Optionreplicator.applier.dbms.embedCommitTime
DescriptionSets whether the commit time for the source row is embedded into the document
Value Typeboolean
Defaulttrue
Valid ValuesfalseDo not embed the source database commit time
 trueEmbed the source database commit time into the stored document

Embeds the commit time of the source database row into the document information:

{
	"_index" : "test",
	"_type" : "messages",
	"_id" : "99999",
	"_version" : 1,
	"found" : true,
	"_source" : {
		"msg" : "Hello Elasticsearch",
		"committime" : "2017-06-06 19:09:20.0",
		"id" : "99999",
		"source_table" : "messages",
		"source_schema" : "test"
	}
}

replicator.applier.dbms.embedSchemaTable

Optionreplicator.applier.dbms.embedSchemaTable
DescriptionEmbed the source schema name and table name in the stored document
Value Typeboolean
Defaulttrue
Valid ValuesfalseDo not embed the schema or database name in the document
 trueEmbed the source schema name and database name into the stored document

If enabled, the documented stored into Elasticsearch will include the source schema and database name. This can be used to identify the source of the information if the schema and table name is not being used for the index and type names (see replicator.applier.dbms.useSchemaAsIndex and replicator.applier.dbms.useTableAsType).

{
	"_index" : "test",
	"_type" : "messages",
	"_id" : "99999",
	"_version" : 1,
	"found" : true,
	"_source" : {
		"msg" : "Hello Elasticsearch",
		"committime" : "2017-06-06 19:09:20.0",
		"id" : "99999",
		"source_table" : "messages",
		"source_schema" : "test"
	}
}

replicator.applier.dbms.ignoreDeleteErrors

Optionreplicator.applier.dbms.ignoreDeleteErrors
DescriptionWhether a failure to delete an entry should raise an error
Value Typeboolean
Defaultfalse
Valid ValuesfalseRaise a failure when deleting records from Elasticsearch fails
 trueIgnore errors when deleting records from Elasticsearch

The replicator.applier.dbms.ignoreDeleteErrors determines whether the replicator will fail when trying to delete an entry in the Elasticsearch index entry. This option can be useful when deleting data in an Elasticsearch target and data does not need to guarantee to be deleted.

replicator.applier.dbms.ignoreUpdateErrors

Optionreplicator.applier.dbms.ignoreUpdateErrors
DescriptionWhether a failure to update an existing entry should raise an error
Value Typeboolean
Defaultfalse
Valid ValuesfalseRaise a failure when updating records from Elasticsearch fails
 trueIgnore errors when updating records from Elasticsearch

The replicator.applier.dbms.ignoreUpdateErrors determines whether the replicator will fail when trying to update an entry in the Elasticsearch index entry. This option can be useful when updating data in an Elasticsearch target and data does not need to guarantee to be deleted.

replicator.applier.dbms.indexName

Optionreplicator.applier.dbms.indexName
DescriptionThe string to be used as the index name when the incoming schema name is not used
Value Typestring

replicator.applier.dbms.selfGeneratedId

Optionreplicator.applier.dbms.selfGeneratedId
DescriptionDetermines whether to use a self generated document id or one derived from the primary key information
Value Typeboolean
Defaultfalse
Valid ValuesfalseUse the primary key column information as the document ID
 trueGet Elasticsearch to self generate an ID

replicator.applier.dbms.typeName

Optionreplicator.applier.dbms.typeName
DescriptionThe string to use as the index type name when the incoming table is not used
Value Typestring

Specifies the type name to be used when replicator.applier.dbms.useTableAsType has been set to false. The value will be used as the index type HTTP://ELASTIC/INDEXNAME/INDEXTYPE.

replicator.applier.dbms.useSchemaAsIndex

Optionreplicator.applier.dbms.useSchemaAsIndex
DescriptionSpecifies whether the incoming schema name for the data should be used as the Index Name
Value Typeboolean
Defaulttrue
Valid ValuesfalseDo not use the incoming schema name as the Elasticsearch index name
 trueUse the incoming schema name as the Elasticsearch index name

Changes whether the string used for the index name within the URL (HTTP://ELASTIC/INDEXNAME/INDEXTYPE). If set to false, the replicator.applier.dbms.typeName must be used to specify the index type.

replicator.applier.dbms.useTableAsType

Optionreplicator.applier.dbms.useTableAsType
DescriptionSpecifies whether the incoming table name for the data should be used as the Index Type
Value Typeboolean
Defaulttrue
Valid ValuesfalseDo not use the incoming table name as the Elasticsearch index type
 trueUse the incoming table name as the Elasticsearch index type

Changes whether the string used for the index type within the URL (HTTP://ELASTIC/INDEXNAME/INDEXTYPE). If set to false, the replicator.applier.dbms.typeName must be used to specify the index type.