public function buildSearchRequest(RequestInterface $request)
    {
        $searchRequest = [
            'size' => $request->getSize(),
        ];

        if ($searchRequest['size'] > 0) {
            $searchRequest['sort'] = $this->getSortOrders($request);
            $searchRequest['from'] = $request->getFrom();
        }

        $query = $this->getRootQuery($request);
        if ($query) {
            $searchRequest['query'] = $query;
        }

        $filter = $this->getRootFilter($request);
        if ($filter) {
            $searchRequest['post_filter'] = $filter;
        }

        $aggregations = $this->getAggregations($request);
        if (!empty($aggregations)) {
            $searchRequest['aggregations'] = $aggregations;
        }

        return $searchRequest;
    }
public function buildSearchRequest(RequestInterface $request)
    {
        $searchRequest = [
            'size' => $request->getSize(),
        ];

        if ($searchRequest['size'] > 0) {
            $searchRequest['sort'] = $this->getSortOrders($request);
            $searchRequest['from'] = $request->getFrom();
        }

        $query = $this->getRootQuery($request);
        if ($query) {
            $searchRequest['query'] = $query;
        }

        $filter = $this->getRootFilter($request);
        if ($filter) {
            $searchRequest['post_filter'] = $filter;
        }

        $aggregations = $this->getAggregations($request);
        if (!empty($aggregations)) {
            $searchRequest['aggregations'] = $aggregations;
        }

        return $searchRequest;
    }
public function buildSearchRequest ( RequestInterface $ request ) { $ searchRequest = [ 'size' => $ request -> getSize ( ) , ] ; if ( $ searchRequest [ 'size' ] > 0 ) { $ searchRequest [ 'sort' ] = $ this -> getSortOrders ( $ request ) ; $ searchRequest [ 'from' ] = $ request -> getFrom ( ) ; } $ query = $ this -> getRootQuery ( $ request ) ; if ( $ query ) { $ searchRequest [ 'query' ] = $ query ; } $ filter = $ this -> getRootFilter ( $ request ) ; if ( $ filter ) { $ searchRequest [ 'post_filter' ] = $ filter ; } $ aggregations = $ this -> getAggregations ( $ request ) ; if ( ! empty ( $ aggregations ) ) { $ searchRequest [ 'aggregations' ] = $ aggregations ; } return $ searchRequest ; }
Transform the search request into an ES request.

@param RequestInterface $request Search Request.

@return array
Transform the search request into an ES request .