我正在使用Elasticsearch JSON Mapping
{
"mappings": {
"test": {
"_routing": {
"path": "harvestdate",
"required": true
},
"_source": {
"enabled": false
},
"properties": {
"infoid": {
"precision_step": "0",
"store": "yes",
"type": "long"
},
"productid": {
"index": "not_analyzed",
"omit_norms": "true",
"omit_term_freq_and_positions": "true",
"store": "yes",
"type": "string"
},
"saleid": {
"precision_step": "0",
"store": "yes",
"type": "long"
}
}
}
}
}
{
"mappings": {
"test": {
"_routing": {
"path": "harvestdate",
"required": true
},
"_source": {
"enabled": false
},
"properties": {
"deal": {
"index": "not_analyzed",
"omit_norms": "true",
"omit_term_freq_and_positions": "true",
"store": "no",
"type": "string"
},
"infoid": {
"precision_step": "0",
"store": "yes",
"type": "long"
},
"productid": {
"index": "not_analyzed",
"omit_norms": "true",
"omit_term_freq_and_positions": "true",
"store": "yes",
"type": "string"
},
"saleid": {
"precision_step": "0",
"store": "yes",
"type": "long"
}
}
}
}
}
我正在尝试使用带有索引(index1)的Elasticsearch使用命令
更新此映射curl -XPUT 'http://localhost:9200/index1/test/_mapping' -d '{
"mappings": {
"test": {
"_routing": {
"path": "harvestdate",
"required": true
},
"_source": {
"enabled": false
},
"properties": {
"deal": {
"index": "not_analyzed",
"omit_norms": "true",
"omit_term_freq_and_positions": "true",
"store": "no",
"type": "string"
},
"infoid": {
"precision_step": "0",
"store": "yes",
"type": "long"
},
"productid": {
"index": "not_analyzed",
"omit_norms": "true",
"omit_term_freq_and_positions": "true",
"store": "yes",
"type": "string"
},
"saleid": {
"precision_step": "0",
"store": "yes",
"type": "long"
}
}
}
}
}'
在检查映射时,映射不是使用Updated设置的 索引中的映射(index1)。这个卷曲或映射中的错误是什么?
提前致谢!
干杯!
答案 0 :(得分:3)
我认为您需要删除
"mappings": {
的事情。从我读到的内容(不记得在哪里,但在弹性搜索邮件列表中,“映射”来自GET
,但在PUTing
和IIRC,他们想要的时候不应该在这里在下一个版本中做一些事情。)