您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch请求正文搜索
发布时间:2021-09-02 19:16:12编辑:雪饮阅读()
ElasticSearch的请求正文搜索区别于前面所接触的URI搜索,URI搜索在地址栏控制参数。
请求正文搜索顾名思义,请求的匹配语法都在请求正文中。
一个最常见的请求正文搜索如:
请求正文:
{
"query":{
"query_string":{
"query":"up"
}
}
}
响应正文:
{
"took": 51,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1.2039728,
"hits": [
{
"_index": "schools",
"_type": "school",
"_id": "3",
"_score": 1.2039728,
"_source": {
"name": "Central School",
"description": "ICSE",
"street": "West End",
"city": "Meerut",
"state": "UP",
"zip": "250002",
"location": [
28.9926174,
77.692485
],
"fees": 3500,
"tags": [
"fully computerized"
],
"rating": "4.5"
}
}
]
}
}
关键字词:elasticSearch,请求正文,搜索