您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch的_all查询关键字(在所有索引中查询)
发布时间:2021-08-23 14:39:25编辑:雪饮阅读()
ElasticSearch中用_all可以不限制索引,即在所有索引中查询某个信息。
如请求:http://localhost:9200/_all/_search
请求方法post
请求体如:
{
"query":{
"query_string":{
"query":"Central"
}
}
}
那么在这里就是使用了所有索引,并在这些索引中去查询”Central”单词。
则其postman请求结果如:
{
"took": 20,
"timed_out": false,
"_shards": {
"total": 3,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 1.0417082,
"hits": [
{
"_index": "schools",
"_type": "school",
"_id": "1",
"_score": 1.0417082,
"_source": {
"name": "Central School",
"description": "CBSE Affiliation",
"street": "Nagan",
"city": "paprola",
"state": "HP",
"zip": "176115",
"location": [
31.8955385,
76.8380405
],
"fees": 2000,
"tags": [
"Senior Secondary",
"beautiful campus"
],
"rating": "3.5"
}
},
{
"_index": "schools2",
"_type": "school",
"_id": "1",
"_score": 1.0417082,
"_source": {
"name": "Central School",
"description": "CBSE Affiliation",
"street": "Nagan",
"city": "paprola",
"state": "HP",
"zip": "176115",
"location": [
31.8955385,
76.8380405
],
"fees": 2000,
"tags": [
"Senior Secondary",
"beautiful campus"
],
"rating": "3.5"
}
}
]
}
}
关键字词:elasticSearch,_all,不限索引
相关文章
- 完全群集重新启动与滚动升级以及elasticSearch多索引
- elasticSearch安装及配置elasticSearch默认对外端口
- windows下使用elasticSearch-head为elasticSearch进行
- windows下使用elasticSearch-head为elasticSearch创建
- 配置elasticSearch-head连接elasticSearch服务
- 配置安装elasticSearch-head
- elasticSearch创建映射和添加数据(_bulk批处理)
- elasticSearch创建没有正文的空索引
- elasticSearch无需查询即可进行过滤(match_all、分数
- elasticSearch过滤与布尔查询