elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档
我已将couchbase文档连接到弹性搜索。我想将每个文档中的字段类型更新为嵌套类型,以便使用嵌套筛选器进行搜索。我尝试了以下映射elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档,elasticsearch,couchbase,elasticsearch,Couchbase,我已将couchbase文档连接到弹性搜索。我想将每个文档中的字段类型更新为嵌套类型,以便使用嵌套筛选器进行搜索。我尝试了以下映射 curl -XPOST localhost:9200/dooht/couchbaseDocument -d {"mappings":{"doc":{"properties":{"services":{"type":"nested","properties":{"name":{"type":"string"},"amount{"type":"long"}}}}
curl -XPOST localhost:9200/dooht/couchbaseDocument -d
{"mappings":{"doc":{"properties":{"services":{"type":"nested","properties":{"name":{"type":"string"},"amount{"type":"long"}}}}}}}
但是它正在用一个新的_id创建一个新文档。我对弹性搜索还不熟悉。关于如何在现有文档中设置嵌套类型字段的任何想法。要创建以
doot
作为索引和doc
作为类型的映射,可以使用
curl -XPUT "http://localhost:9200/dooht" -d "{\"mappings\":{\"doc\":{\"properties\":{\"services\":{\"type\":\"nested\",\"properties\":{\"name\":{\"type\":\"string\"},\"amount\":{\"type\":\"long\"}}}}}}}"
请参见参考是否要更新现有字段或创建新的嵌套字段?