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": "花" } }
]
}
}
}