最簡單的查詢,匹配全部文檔,使它們的_score
爲1.0。json
GET /_search { "query": { "match_all": {} } }
或curl命令:app
curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d' { "query": { "match_all": {} } } '
可使用boost
參數更改_score
:curl
GET /_search { "query": { "match_all": { "boost" : 1.2 } } }
或curl命令:url
curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d' { "query": { "match_all": { "boost" : 1.2 } } } '
這是match_all
查詢的相反,它不匹配任何文檔。code
GET /_search { "query": { "match_none": {} } }
或curl命令:文檔
curl -X GET "localhost:9200/_search" -H 'Content-Type: application/json' -d' { "query": { "match_none": {} } } '