Kibana+ElasticSearch实现索引数据的几种查询方式

 

 

1.match_all搜索,直接返回所有文档


GET /school/_search
{
"query": {
"match_all": {

}
}
}

 

 

 2.执行查询
   2.1 只显示name和address

 

POST /school/_search
{
"query": { "match_all": {} },
"_source": ["name", "address"]
}

POST /school/_search
{
"query": {
"bool": {
"should": [
{ "match": { "name": "海" } },
{ "match": { "name": "花" } }
]
}
}
}

 

posted @ 2021-05-18 10:53  技术颜良  阅读(1569)  评论(0编辑  收藏  举报