我正在使用弹性支撑部件https://camel.apache.org/components/latest/elasticsearch-rest-component.html我无法以任何方式指定文档的ID。从这个意义上说,文档似乎很缺乏
代码或多或少像
from(RAW_ROUTE)
.process(new RawProcessor())
.to("elasticsearch://local?operation=Index&indexName=raw&indexType=_doc")
;
RawProcessor将Map设置为交换对象的主体
非常感谢
[_id
可以用indexId
标头设置。
索引:将内容添加到索引,并在正文中返回内容的indexId。您可以通过使用键“ indexId”]设置消息头来设置indexId
您可以在单元测试
ElasticsearchIndexTest#testIndexWithIDInHeader
中找到示例用法。