PHP Class Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\QueryBuilder

Author: Aurelien FOUCRET ([email protected])
显示文件 Open project: smile-sa/elasticsuite Class Usage Examples

Public Methods

Method Description
__construct ( AttributeList $attributeList, QueryFactory $queryFactory, Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\NestedFilterInterface[] $nestedFilters = [] ) Constructor.
getSearchQuery ( Product $productCondition ) : Smile\ElasticsuiteCore\Search\Request\QueryInterface Build the query for a condition.

Private Methods

Method Description
applyNegation ( Smile\ElasticsuiteCore\Search\Request\QueryInterface $query ) : Smile\ElasticsuiteCore\Search\Request\QueryInterface Apply a negation to the current query.
getHasImageQuery ( ) : Smile\ElasticsuiteCore\Search\Request\QueryInterface Has image query.
getMatchQueryParams ( Product $productCondition ) : array Retrieve params for a match query from condition.
getRangeQueryParams ( Product $productCondition ) : array Retrieve params for a range query from condition.
getSearchField ( Product $productCondition ) : Smile\ElasticsuiteCore\Model\Search\Request\RelevanceConfig\FieldInterface Retrieve ES mapping field for the current condition.
getSearchFieldName ( Product $productCondition ) : string Retrieve ES mapping field name used for the current condition (including analyzer).
getSpecialAttributesSearchQuery ( Product $productCondition ) : null | Smile\ElasticsuiteCore\Search\Request\QueryInterface Create a query for special attribute.
getTermsQueryParams ( Product $productCondition ) : array Retrieve params for a terms query from condition.
prepareFieldValue ( Product $productCondition ) Update the condition value to ignore empty array items.
prepareQuery ( string $queryType, array $queryParams ) : Smile\ElasticsuiteCore\Search\Request\QueryInterface Instantiate query from type and params.

Method Details

__construct() public method

Constructor.
public __construct ( AttributeList $attributeList, QueryFactory $queryFactory, Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\NestedFilterInterface[] $nestedFilters = [] )
$attributeList AttributeList Search rule product attributes list
$queryFactory Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory Search query factory.
$nestedFilters Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\NestedFilterInterface[] Filters applied to nested fields during query building.

getSearchQuery() public method

Build the query for a condition.
public getSearchQuery ( Product $productCondition ) : Smile\ElasticsuiteCore\Search\Request\QueryInterface
$productCondition Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product Product condition.
return Smile\ElasticsuiteCore\Search\Request\QueryInterface