public function getRequest(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
    {
        $storeId = $this->getCurrentStoreId();

        $containerName = $searchCriteria->getRequestName();

        $containerConfiguration = $this->getSearchContainerConfiguration($storeId, $containerName);

        $size = $searchCriteria->getPageSize() ?? self::DEFAULT_PAGE_SIZE;
        $from = max(0, (int) $searchCriteria->getCurrentPage() - 1) * $size;

        $queryText  = $this->getFulltextFilter($searchCriteria);

        $sortOrders = $this->requestMapper->getSortOrders($containerConfiguration, $searchCriteria);
        $filters    = $this->requestMapper->getFilters($containerConfiguration, $searchCriteria);

        $this->updateSearchContext($storeId, $queryText);

        return $this->searchRequestBuilder->create($storeId, $containerName, $from, $size, $queryText, $sortOrders, $filters, []);
    }
public function getRequest(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
    {
        $storeId = $this->getCurrentStoreId();

        $containerName = $searchCriteria->getRequestName();

        $containerConfiguration = $this->getSearchContainerConfiguration($storeId, $containerName);

        $size = $searchCriteria->getPageSize() ?? self::DEFAULT_PAGE_SIZE;
        $from = max(0, (int) $searchCriteria->getCurrentPage() - 1) * $size;

        $queryText  = $this->getFulltextFilter($searchCriteria);

        $sortOrders = $this->requestMapper->getSortOrders($containerConfiguration, $searchCriteria);
        $filters    = $this->requestMapper->getFilters($containerConfiguration, $searchCriteria);

        $this->updateSearchContext($storeId, $queryText);

        return $this->searchRequestBuilder->create($storeId, $containerName, $from, $size, $queryText, $sortOrders, $filters, []);
    }
public function getRequest ( \ Magento \ Framework \ Api \ Search \ SearchCriteriaInterface $ searchCriteria ) { $ storeId = $ this -> getCurrentStoreId ( ) ; $ containerName = $ searchCriteria -> getRequestName ( ) ; $ containerConfiguration = $ this -> getSearchContainerConfiguration ( $ storeId , $ containerName ) ; $ size = $ searchCriteria -> getPageSize ( ) ?? self :: DEFAULT_PAGE_SIZE ; $ from = max ( 0 , ( int ) $ searchCriteria -> getCurrentPage ( ) - 1 ) * $ size ; $ queryText = $ this -> getFulltextFilter ( $ searchCriteria ) ; $ sortOrders = $ this -> requestMapper -> getSortOrders ( $ containerConfiguration , $ searchCriteria ) ; $ filters = $ this -> requestMapper -> getFilters ( $ containerConfiguration , $ searchCriteria ) ; $ this -> updateSearchContext ( $ storeId , $ queryText ) ; return $ this -> searchRequestBuilder -> create ( $ storeId , $ containerName , $ from , $ size , $ queryText , $ sortOrders , $ filters , [ ] ) ; }
Build a search request from a search criteria.

@param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria Search criteria.

@return \Smile\ElasticsuiteCore\Search\RequestInterface
Build a search request from a search criteria .