2013-08-28 19:24:34 -04:00
|
|
|
[[query-dsl-match-all-query]]
|
2019-07-18 10:18:11 -04:00
|
|
|
== Match all query
|
|
|
|
++++
|
|
|
|
<titleabbrev>Match all</titleabbrev>
|
|
|
|
++++
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2015-06-03 19:59:22 -04:00
|
|
|
The most simple query, which matches all documents, giving them all a `_score`
|
|
|
|
of `1.0`.
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_all": {}
|
|
|
|
}
|
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
|
2015-06-03 19:59:22 -04:00
|
|
|
The `_score` can be changed with the `boost` parameter:
|
2013-08-28 19:24:34 -04:00
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_all": { "boost" : 1.2 }
|
|
|
|
}
|
|
|
|
}
|
2013-08-28 19:24:34 -04:00
|
|
|
--------------------------------------------------
|
2015-11-02 06:57:35 -05: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 12:35:50 -04:00
|
|
|
[source,console]
|
2015-11-02 06:57:35 -05:00
|
|
|
--------------------------------------------------
|
2016-05-24 05:58:43 -04:00
|
|
|
GET /_search
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_none": {}
|
|
|
|
}
|
|
|
|
}
|
2015-11-02 06:57:35 -05:00
|
|
|
--------------------------------------------------
|