Match all queryedit

The most simple query, which matches all documents, giving them all a _score of 1.0.

$params = [
    'body' => [
        'query' => [
            'match_all' => [
            ],
        ],
    ],
];
$response = $client->search($params);
var searchResponse = client.Search<object>(s => s
    .AllIndices()
    .MatchAll(m => m));
resp = client.search(body={"query": {"match_all": {}}})
print(resp)
response = client.search(
  body: {
    query: {
      match_all: {
      }
    }
  }
)
puts response
res, err := es.Search(
	es.Search.WithBody(strings.NewReader(`{
	  "query": {
	    "match_all": {}
	  }
	}`)),
	es.Search.WithPretty(),
)
fmt.Println(res, err)
const response = await client.search({
  body: {
    query: {
      match_all: {}
    }
  }
})
console.log(response)
GET /_search
{
    "query": {
        "match_all": {}
    }
}

The _score can be changed with the boost parameter:

$params = [
    'body' => [
        'query' => [
            'match_all' => [
                'boost' => 1.2,
            ],
        ],
    ],
];
$response = $client->search($params);
var searchResponse = client.Search<object>(s => s
    .AllIndices()
    .MatchAll(m => m.Boost(1.2)));
resp = client.search(body={"query": {"match_all": {"boost": 1.2}}})
print(resp)
response = client.search(
  body: {
    query: {
      match_all: {
        boost: 1.2
      }
    }
  }
)
puts response
res, err := es.Search(
	es.Search.WithBody(strings.NewReader(`{
	  "query": {
	    "match_all": {
	      "boost": 1.2
	    }
	  }
	}`)),
	es.Search.WithPretty(),
)
fmt.Println(res, err)
const response = await client.search({
  body: {
    query: {
      match_all: {
        boost: 1.2
      }
    }
  }
})
console.log(response)
GET /_search
{
    "query": {
        "match_all": { "boost" : 1.2 }
    }
}

Match None Queryedit

This is the inverse of the match_all query, which matches no documents.

$params = [
    'body' => [
        'query' => [
            'match_none' => [
            ],
        ],
    ],
];
$response = $client->search($params);
var searchResponse = client.Search<object>(s => s
    .AllIndices()
    .Query(q => q.MatchNone())
);
resp = client.search(body={"query": {"match_none": {}}})
print(resp)
response = client.search(
  body: {
    query: {
      match_none: {
      }
    }
  }
)
puts response
res, err := es.Search(
	es.Search.WithBody(strings.NewReader(`{
	  "query": {
	    "match_none": {}
	  }
	}`)),
	es.Search.WithPretty(),
)
fmt.Println(res, err)
const response = await client.search({
  body: {
    query: {
      match_none: {}
    }
  }
})
console.log(response)
GET /_search
{
    "query": {
        "match_none": {}
    }
}