gpt4 book ai didi

elasticsearch - 如何获取字段的doc_values值?

转载 作者:行者123 更新时间:2023-12-03 02:34:06 24 4
gpt4 key购买 nike

如何修改下面的查询以获取字段的doc_values?

flex 2.3
curl 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com