如何修改下面的查询以获取字段的doc_values?
flex 2.3curl http://localhost:9200/_mapping
退货{
"my_index": {
"mappings": {
"my_type": {
"properties": {
"my_field": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
最佳答案
curl -X PUT "elasticsearch:9200/my_index?pretty" -H 'Content-Type: application/json' -d'
{
"mappings": {
"my_index": {
"properties": {
"status_code": {
"type": "string",
"index": "not_analyzed"
},
"session_id": {
"type": "string",
"index": "not_analyzed",
"doc_values": false
}
}
}
}
}
响应curl "elasticsearch:9200/my_index/_mapping?pretty"
{
"my_index" : {
"mappings" : {
"my_index" : {
"properties" : {
"session_id" : {
"type" : "string",
"index" : "not_analyzed",
"doc_values" : false
},
"status_code" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
}
doc_values
默认为true。在这种情况下未显示。但是显示doc_values
== false。
引用:https://www.elastic.co/guide/en/elasticsearch/reference/2.3/doc-values.html
关于elasticsearch - 如何获取字段的doc_values值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59284031/