admin 管理员组文章数量: 1087652
2024年3月13日发(作者:css设置超链接没有下划线)
GET my_index_json/_search
{
"query": {
"range": {
"": {
"gte": 10,
"lte": 29
}
}
},
"size": 1000
}
返回数据
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "my_index_json",
"_type" : "_doc",
"_id" : "2",
"_score" : 1.0,
"_source" : {
"username" : "xiaozhang",
"other" : [
{
"age" : 28,
"last" : "Smith",
"datetime" : "2020-01-01",
"weight" : 50.0
}
]
}
}
]
}
}
根据条件检索2
GET /my_index_json/_search
{
"size" : 1,
"query": {
"bool": {
"must": [
{ "match": { "": "100" }}
]
}
}
}
返回数据
{
"took" : 55,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.2876821,
"hits" : [
{
"_index" : "my_index_json",
"_type" : "_doc",
"_id" : "3",
"_score" : 0.2876821,
"_source" : {
"username" : "xiaosi",
"other" : [
{
"age" : 25,
"last" : "yes",
"datetime" : "2020-01-01",
"weight" : 48.0,
"addone" : "100"
}
]
}
}
]
}
}
版权声明:本文标题:Elasticsearch存储json格式数据 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1710295903a566602.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论