public function getSearchRequestParams(
        ContainerConfigurationInterface $containerConfig,
        $category = null,
        $queryText = null,
        $size = 20
    ) {
        $sortOrders = [];

        $query = $this->queryFactory->create(\Magento\Framework\Search\Request\QueryInterface::TYPE_BOOL, []);

        if ($queryText !== null) {
            $query = $this->searchQueryBuilder->getFullTextQuery($containerConfig, $queryText);
        } elseif ($category !== null) {
            $query      = $this->categoryQueryBuilder->getCategorySearchQuery($containerConfig, $category);
            $sortOrders = $this->categoryQueryBuilder->getCategorySortOrders($category);
        }

        $requestParams = [
            'name'       => $containerConfig->getName(),
            'indexName'  => $containerConfig->getIndexName(),
            'type'       => $containerConfig->getTypeName(),
            'from'       => 0,
            'size'       => $size,
            'dimensions' => [],
            'query'      => $query,
            'sortOrders' => $this->sortOrderBuilder->buildSordOrders($containerConfig, $sortOrders),
            'buckets'    => [],
        ];

        return $requestParams;
    }
public function getSearchRequestParams(
        ContainerConfigurationInterface $containerConfig,
        $category = null,
        $queryText = null,
        $size = 20
    ) {
        $sortOrders = [];

        $query = $this->queryFactory->create(\Magento\Framework\Search\Request\QueryInterface::TYPE_BOOL, []);

        if ($queryText !== null) {
            $query = $this->searchQueryBuilder->getFullTextQuery($containerConfig, $queryText);
        } elseif ($category !== null) {
            $query      = $this->categoryQueryBuilder->getCategorySearchQuery($containerConfig, $category);
            $sortOrders = $this->categoryQueryBuilder->getCategorySortOrders($category);
        }

        $requestParams = [
            'name'       => $containerConfig->getName(),
            'indexName'  => $containerConfig->getIndexName(),
            'type'       => $containerConfig->getTypeName(),
            'from'       => 0,
            'size'       => $size,
            'dimensions' => [],
            'query'      => $query,
            'sortOrders' => $this->sortOrderBuilder->buildSordOrders($containerConfig, $sortOrders),
            'buckets'    => [],
        ];

        return $requestParams;
    }
public function getSearchRequestParams ( ContainerConfigurationInterface $ containerConfig , $ category = null , $ queryText = null , $ size = 20 ) { $ sortOrders = [ ] ; $ query = $ this -> queryFactory -> create ( \ Magento \ Framework \ Search \ Request \ QueryInterface :: TYPE_BOOL , [ ] ) ; if ( $ queryText !== null ) { $ query = $ this -> searchQueryBuilder -> getFullTextQuery ( $ containerConfig , $ queryText ) ; } elseif ( $ category !== null ) { $ query = $ this -> categoryQueryBuilder -> getCategorySearchQuery ( $ containerConfig , $ category ) ; $ sortOrders = $ this -> categoryQueryBuilder -> getCategorySortOrders ( $ category ) ; } $ requestParams = [ 'name' => $ containerConfig -> getName ( ) , 'indexName' => $ containerConfig -> getIndexName ( ) , 'type' => $ containerConfig -> getTypeName ( ) , 'from' => 0 , 'size' => $ size , 'dimensions' => [ ] , 'query' => $ query , 'sortOrders' => $ this -> sortOrderBuilder -> buildSordOrders ( $ containerConfig , $ sortOrders ) , 'buckets' => [ ] , ] ; return $ requestParams ; }
Prepare the Search Request Params

@param ContainerConfigurationInterface $containerConfig Container Configuration
@param CategoryInterface               $category        The category
@param string                          $queryText       The query text
@param int                             $size            Query Size

@return array
Prepare the Search Request Params