PHP Class Smile\ElasticsuiteCore\Search\Request\SortOrder\SortOrderBuilder

Author: Aurelien FOUCRET ([email protected])
Show file Open project: smile-sa/elasticsuite

Public Methods

Method Description
__construct ( StandardFactory $standardOrderFactory, NestedFactory $nestedOrderFactory, QueryBuilder $queryBuilder ) Constructor.
buildSordOrders ( Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfigurationInterface $containerConfig, array $orders ) : Smile\ElasticsuiteCore\Search\Request\SortOrderInterface[] Build sort orders from array of sort orders definition.

Private Methods

Method Description
addDefaultSortOrders ( array $orders, Smile\ElasticsuiteCore\Api\Index\MappingInterface $mapping ) : array Append default sort to all queries to get fully predictable search results.
getSortOrderParams ( Smile\ElasticsuiteCore\Api\Index\Mapping\FieldInterface $field, array $sortOrderParams ) : array Retrieve base params for a sort order field.

Method Details

__construct() public method

Constructor.
public __construct ( StandardFactory $standardOrderFactory, NestedFactory $nestedOrderFactory, QueryBuilder $queryBuilder )
$standardOrderFactory StandardFactory Standard sort order factory.
$nestedOrderFactory NestedFactory Nested sort order factory.
$queryBuilder Smile\ElasticsuiteCore\Search\Request\Query\Filter\QueryBuilder Query builder used to build queries inside nested sort order.

buildSordOrders() public method

Build sort orders from array of sort orders definition.
public buildSordOrders ( Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfigurationInterface $containerConfig, array $orders ) : Smile\ElasticsuiteCore\Search\Request\SortOrderInterface[]
$containerConfig Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfigurationInterface Request configuration.
$orders array Sort orders definitions.
return Smile\ElasticsuiteCore\Search\Request\SortOrderInterface[]