2013-08-29 07:24:34 +08:00
|
|
|
[[query-dsl-match-all-query]]
|
2019-07-18 22:18:11 +08:00
|
|
|
== Match all query
|
|
|
|
++++
|
|
|
|
<titleabbrev>Match all</titleabbrev>
|
|
|
|
++++
|
2013-08-29 07:24:34 +08:00
|
|
|
|
2015-06-04 07:59:22 +08:00
|
|
|
The most simple query, which matches all documents, giving them all a `_score`
|
|
|
|
of `1.0`.
|
2013-08-29 07:24:34 +08:00
|
|
|
|
2019-09-09 22:45:37 +08:00
|
|
|
[source,console]
|
2013-08-29 07:24:34 +08:00
|
|
|
--------------------------------------------------
|
2016-05-24 17:58:43 +08:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_all": {}
|
|
|
|
}
|
|
|
|
}
|
2013-08-29 07:24:34 +08:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2015-06-04 07:59:22 +08:00
|
|
|
The `_score` can be changed with the `boost` parameter:
|
2013-08-29 07:24:34 +08:00
|
|
|
|
2019-09-09 22:45:37 +08:00
|
|
|
[source,console]
|
2013-08-29 07:24:34 +08:00
|
|
|
--------------------------------------------------
|
2016-05-24 17:58:43 +08:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_all": { "boost" : 1.2 }
|
|
|
|
}
|
|
|
|
}
|
2013-08-29 07:24:34 +08:00
|
|
|
--------------------------------------------------
|
2015-11-02 19:57:35 +08:00
|
|
|
|
|
|
|
[[query-dsl-match-none-query]]
|
|
|
|
[float]
|
|
|
|
== Match None Query
|
|
|
|
|
|
|
|
This is the inverse of the `match_all` query, which matches no documents.
|
|
|
|
|
2019-09-09 22:45:37 +08:00
|
|
|
[source,console]
|
2015-11-02 19:57:35 +08:00
|
|
|
--------------------------------------------------
|
2016-05-24 17:58:43 +08:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_none": {}
|
|
|
|
}
|
|
|
|
}
|
2015-11-02 19:57:35 +08:00
|
|
|
--------------------------------------------------
|