【发布时间】:2023-04-03 06:23:01
【问题描述】:
我正在尝试为每个数据源创建一个具有多种类型的索引。
以下映射确实为一种类型创建映射:
curl -XPUT localhost:9200/test -d '{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"type1" : {
"_source" : { "enabled" : false },
"properties" : {
"field1" : { "type" : "string", "index" : "not_analyzed" }
}
}
},
"mappings" : {
"type2" : {
"_source" : { "enabled" : false },
"properties" : {
"source1" : { "type" : "string", "index" : "not_analyzed" }
}
}
}
}'
当我运行这个时:
curl -X GET 'http://localhost:9200/test/tpe1/_mapping?pretty=true'
什么都不显示。
如何在弹性搜索中为多种类型创建映射?
【问题讨论】:
标签: types elasticsearch mapping