Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/clojure/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Couchbase - Fatal编程技术网 elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档,elasticsearch,couchbase,elasticsearch,Couchbase" /> elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档,elasticsearch,couchbase,elasticsearch,Couchbase" />

elasticsearch 将字段类型更新为';嵌套';在弹性搜索中创建新文档

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"}}}}

我已将couchbase文档连接到弹性搜索。我想将每个文档中的字段类型更新为嵌套类型,以便使用嵌套筛选器进行搜索。我尝试了以下映射

 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\"}}}}}}}"

请参见参考

是否要更新现有字段或创建新的嵌套字段?