src/Search/Elastica/QueryFactory.php
protected function filterStatuses(SearchNodesRequest $request, Query\BoolQuery $query): void
    {
        if (!$request->has('statuses')) {
            return;
        }

        $statuses = array_map('strval', $request->get('statuses'));
        $query->addFilter(new Query\Terms('status', $statuses));
    }
protected function filterStatuses(SearchNodesRequest $request, Query\BoolQuery $query): void
    {
        if (!$request->has('statuses')) {
            return;
        }

        $statuses = array_map('strval', $request->get('statuses'));
        $query->addFilter(new Query\Terms('status', $statuses));
    }
protected function filterStatuses ( SearchNodesRequest $ request , Query \ BoolQuery $ query ) : void { if ( ! $ request -> has ( 'statuses' ) ) { return ; } $ statuses = array_map ( 'strval' , $ request -> get ( 'statuses' ) ) ; $ query -> addFilter ( new Query \ Terms ( 'status' , $ statuses ) ) ; }
Add the "statuses" into one terms query as it's more efficient.

@link https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html

@param SearchNodesRequest $request
@param Query\BoolQuery    $query
Add the statuses into one terms query as it s more efficient .