Couchbase - Elasticsearch - 传输。映射到类型
Couchbase - Elasticsearch - transport. Mapping to types
我有下一个问题:
我在 couchbase 中有一个桶 - 名为 cars。
我在 elasticsearch 中有索引 - 名为 test
我映射了我的文档。
在 elasticsearch 配置中我设置:
couchbase.typeSelector.defaultDocumentType: 'Test'
couchbase.typeSelector.documentTypeDelimiter: '_'
我开始从 couchbase 复制到 elasticsearch。
但是!我所有的文档都将使用默认类型 (Test)
我也尝试过使用 doc.NameOfProperty 进行映射 - 但它对我没有帮助:(
我不知道为什么它不起作用。
我的目标 - 通过 TYPE.
将文档从 couchbase 设置到 elasticsearch
谢谢。
您缺少文档类型选择器设置。默认情况下,插件使用 DefaultTypeSelector
,它只是将所有文档分配给 defaultDocumentType,在您的情况下是 "Test"。
要让插件通过根据分隔符拆分 id 来将文档分配给类型,您需要告诉插件使用 DelimiterTypeSelector
。将以下行添加到您的 elasticsearch.yml 以配合您的配置中已有的内容:
couchbase.typeSelector: org.elasticsearch.transport.couchbase.capi.DelimiterTypeSelector
这样,插件会将任何具有 "Something_123" 形式的 ID 的文档分配给类型 "Something",并将所有其他文档分配给类型 "Test".
你的 couchbase 相关设置应该如下所示:
couchbase.username: Administrator
couchbase.password: 12345 # Same as the combination on my luggage
couchbase.ignoreFailures: true
couchbase.wrapCounters: true
couchbase.ignoreDotIndexes: true
couchbase.typeSelector: org.elasticsearch.transport.couchbase.capi.DelimiterTypeSelector
couchbase.typeSelector.documentTypeDelimiter: '_'
couchbase.typeSelector.defaultDocumentType: 'Test'
我有下一个问题:
我在 couchbase 中有一个桶 - 名为 cars。 我在 elasticsearch 中有索引 - 名为 test
我映射了我的文档。 在 elasticsearch 配置中我设置:
couchbase.typeSelector.defaultDocumentType: 'Test'
couchbase.typeSelector.documentTypeDelimiter: '_'
我开始从 couchbase 复制到 elasticsearch。 但是!我所有的文档都将使用默认类型 (Test)
我也尝试过使用 doc.NameOfProperty 进行映射 - 但它对我没有帮助:(
我不知道为什么它不起作用。
我的目标 - 通过 TYPE.
将文档从 couchbase 设置到 elasticsearch谢谢。
您缺少文档类型选择器设置。默认情况下,插件使用 DefaultTypeSelector
,它只是将所有文档分配给 defaultDocumentType,在您的情况下是 "Test"。
要让插件通过根据分隔符拆分 id 来将文档分配给类型,您需要告诉插件使用 DelimiterTypeSelector
。将以下行添加到您的 elasticsearch.yml 以配合您的配置中已有的内容:
couchbase.typeSelector: org.elasticsearch.transport.couchbase.capi.DelimiterTypeSelector
这样,插件会将任何具有 "Something_123" 形式的 ID 的文档分配给类型 "Something",并将所有其他文档分配给类型 "Test".
你的 couchbase 相关设置应该如下所示:
couchbase.username: Administrator
couchbase.password: 12345 # Same as the combination on my luggage
couchbase.ignoreFailures: true
couchbase.wrapCounters: true
couchbase.ignoreDotIndexes: true
couchbase.typeSelector: org.elasticsearch.transport.couchbase.capi.DelimiterTypeSelector
couchbase.typeSelector.documentTypeDelimiter: '_'
couchbase.typeSelector.defaultDocumentType: 'Test'