repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Attribute/Source/FilterDisplayMode.php | FilterDisplayMode.toOptionArray | public function toOptionArray()
{
return [
['label' => __('Auto'), 'value' => self::AUTO_DISPLAYED],
['label' => __('Always hidden'), 'value' => self::ALWAYS_HIDDEN],
['label' => __('Always displayed'), 'value' => self::ALWAYS_DISPLAYED],
];
} | php | public function toOptionArray()
{
return [
['label' => __('Auto'), 'value' => self::AUTO_DISPLAYED],
['label' => __('Always hidden'), 'value' => self::ALWAYS_HIDDEN],
['label' => __('Always displayed'), 'value' => self::ALWAYS_DISPLAYED],
];
} | [
"public",
"function",
"toOptionArray",
"(",
")",
"{",
"return",
"[",
"[",
"'label'",
"=>",
"__",
"(",
"'Auto'",
")",
",",
"'value'",
"=>",
"self",
"::",
"AUTO_DISPLAYED",
"]",
",",
"[",
"'label'",
"=>",
"__",
"(",
"'Always hidden'",
")",
",",
"'value'",
... | Return array of display mode
@return array | [
"Return",
"array",
"of",
"display",
"mode"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Attribute/Source/FilterDisplayMode.php#L53-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Category/Attribute/Source/VirtualCategoryRoot/CollectionFactory.php | CollectionFactory.create | public function create(array $data = [])
{
$collection = parent::create($data);
if ($this->getCurrentCategory() && $this->getCurrentCategory()->getLevel() >= 2) {
$collection->addAttributeToFilter('entity_id', ['neq' => (int) $this->getCurrentCategory()->getId()]);
$rootPat... | php | public function create(array $data = [])
{
$collection = parent::create($data);
if ($this->getCurrentCategory() && $this->getCurrentCategory()->getLevel() >= 2) {
$collection->addAttributeToFilter('entity_id', ['neq' => (int) $this->getCurrentCategory()->getId()]);
$rootPat... | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"collection",
"=",
"parent",
"::",
"create",
"(",
"$",
"data",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getCurrentCategory",
"(",
")",
"&&",
"$",
"this",
"->",... | Create collection
@param array $data Collection data
@return \Magento\Catalog\Model\ResourceModel\Category\Collection
@throws \Magento\Framework\Exception\LocalizedException | [
"Create",
"collection"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Source/VirtualCategoryRoot/CollectionFactory.php#L53-L66 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Category/Attribute/Source/VirtualCategoryRoot/CollectionFactory.php | CollectionFactory.getCurrentCategory | private function getCurrentCategory()
{
$category = false;
if ($this->registry->registry('current_category') && $this->registry->registry('current_category')->getId()) {
$category = $this->registry->registry('current_category');
}
return $category;
} | php | private function getCurrentCategory()
{
$category = false;
if ($this->registry->registry('current_category') && $this->registry->registry('current_category')->getId()) {
$category = $this->registry->registry('current_category');
}
return $category;
} | [
"private",
"function",
"getCurrentCategory",
"(",
")",
"{",
"$",
"category",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"registry",
"->",
"registry",
"(",
"'current_category'",
")",
"&&",
"$",
"this",
"->",
"registry",
"->",
"registry",
"(",
"'curren... | Get the currently edited category, if any.
@return \Magento\Catalog\Model\Category | [
"Get",
"the",
"currently",
"edited",
"category",
"if",
"any",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Category/Attribute/Source/VirtualCategoryRoot/CollectionFactory.php#L73-L82 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Plugin/CatalogSearch/Indexer/FulltextPlugin.php | FulltextPlugin.afterExecuteFull | public function afterExecuteFull(\Magento\CatalogSearch\Model\Indexer\Fulltext $subject, $result)
{
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categories */
$categories = $this->categoryCollectionFactory->create();
// Can occur during setup:install.
if (false... | php | public function afterExecuteFull(\Magento\CatalogSearch\Model\Indexer\Fulltext $subject, $result)
{
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categories */
$categories = $this->categoryCollectionFactory->create();
// Can occur during setup:install.
if (false... | [
"public",
"function",
"afterExecuteFull",
"(",
"\\",
"Magento",
"\\",
"CatalogSearch",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Fulltext",
"$",
"subject",
",",
"$",
"result",
")",
"{",
"/** @var \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Collection $categories */",
... | After a full reindex of catalogsearch_fulltext index :
- cleanup the cache tag of each virtual category and their parents.
@param \Magento\CatalogSearch\Model\Indexer\Fulltext $subject Catalog product fulltext indexer
@param void $result Void result
@return void
@SuppressWarn... | [
"After",
"a",
"full",
"reindex",
"of",
"catalogsearch_fulltext",
"index",
":",
"-",
"cleanup",
"the",
"cache",
"tag",
"of",
"each",
"virtual",
"category",
"and",
"their",
"parents",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/CatalogSearch/Indexer/FulltextPlugin.php#L69-L97 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Plugin/CatalogSearch/Indexer/FulltextPlugin.php | FulltextPlugin.cleanCategoryCacheByIds | private function cleanCategoryCacheByIds(array $categoryIds)
{
$this->cacheContext->registerEntities(\Magento\Catalog\Model\Category::CACHE_TAG, $categoryIds);
$this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]);
} | php | private function cleanCategoryCacheByIds(array $categoryIds)
{
$this->cacheContext->registerEntities(\Magento\Catalog\Model\Category::CACHE_TAG, $categoryIds);
$this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]);
} | [
"private",
"function",
"cleanCategoryCacheByIds",
"(",
"array",
"$",
"categoryIds",
")",
"{",
"$",
"this",
"->",
"cacheContext",
"->",
"registerEntities",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"::",
"CACHE_TAG",
",",
"$",
"cat... | Clean cache of frontend pages based on category ids.
@param array $categoryIds Category Ids | [
"Clean",
"cache",
"of",
"frontend",
"pages",
"based",
"on",
"category",
"ids",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Plugin/CatalogSearch/Indexer/FulltextPlugin.php#L104-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/DataProvider/Decimal.php | Decimal.validateFilter | public function validateFilter($filter)
{
// Match a regex pattern instead of just exploding on '-' (this fail with negative numbers).
$regexp = "/(-?[0-9]+)-(-?[0-9]+)/";
preg_match_all($regexp, $filter, $matches);
// Whole match + two groups matches.
if (count($matches) !=... | php | public function validateFilter($filter)
{
// Match a regex pattern instead of just exploding on '-' (this fail with negative numbers).
$regexp = "/(-?[0-9]+)-(-?[0-9]+)/";
preg_match_all($regexp, $filter, $matches);
// Whole match + two groups matches.
if (count($matches) !=... | [
"public",
"function",
"validateFilter",
"(",
"$",
"filter",
")",
"{",
"// Match a regex pattern instead of just exploding on '-' (this fail with negative numbers).",
"$",
"regexp",
"=",
"\"/(-?[0-9]+)-(-?[0-9]+)/\"",
";",
"preg_match_all",
"(",
"$",
"regexp",
",",
"$",
"filte... | Validate and parse filter request param.
Use this one instead of the legacy to ensure negative values are properly computed.
@param string $filter The raw filter value (XXX-XXX)
@return array|bool | [
"Validate",
"and",
"parse",
"filter",
"request",
"param",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/DataProvider/Decimal.php#L34-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Terms/NoResultTerms/AggregationProvider.php | AggregationProvider.getAggregation | public function getAggregation()
{
$aggParams = [
'field' => 'search_query_void.sortable',
'name' => 'search_terms',
'metrics' => $this->getMetrics(),
'pipelines' => $this->getPipelines(),
'sortOrder' => ['unique_sessions' => 'desc'],
... | php | public function getAggregation()
{
$aggParams = [
'field' => 'search_query_void.sortable',
'name' => 'search_terms',
'metrics' => $this->getMetrics(),
'pipelines' => $this->getPipelines(),
'sortOrder' => ['unique_sessions' => 'desc'],
... | [
"public",
"function",
"getAggregation",
"(",
")",
"{",
"$",
"aggParams",
"=",
"[",
"'field'",
"=>",
"'search_query_void.sortable'",
",",
"'name'",
"=>",
"'search_terms'",
",",
"'metrics'",
"=>",
"$",
"this",
"->",
"getMetrics",
"(",
")",
",",
"'pipelines'",
"=... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Terms/NoResultTerms/AggregationProvider.php#L32-L44 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/Customer/TrackingService.php | TrackingService.addEvent | public function addEvent($eventData)
{
if ($this->helper->isEnabled()) {
$this->eventQueue->addEvent($eventData);
$this->addCustomerLink($eventData);
}
} | php | public function addEvent($eventData)
{
if ($this->helper->isEnabled()) {
$this->eventQueue->addEvent($eventData);
$this->addCustomerLink($eventData);
}
} | [
"public",
"function",
"addEvent",
"(",
"$",
"eventData",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"helper",
"->",
"isEnabled",
"(",
")",
")",
"{",
"$",
"this",
"->",
"eventQueue",
"->",
"addEvent",
"(",
"$",
"eventData",
")",
";",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/Customer/TrackingService.php#L68-L74 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/Customer/TrackingService.php | TrackingService.anonymizeCustomerData | public function anonymizeCustomerData(int $customerId, \DateTime $delay = null)
{
// If delay is not null, apply this delay to the customer data.
if ($delay !== null) {
$this->customerLinkResource->setDeleteAfter($customerId, $delay);
}
// If delay is null, process delet... | php | public function anonymizeCustomerData(int $customerId, \DateTime $delay = null)
{
// If delay is not null, apply this delay to the customer data.
if ($delay !== null) {
$this->customerLinkResource->setDeleteAfter($customerId, $delay);
}
// If delay is null, process delet... | [
"public",
"function",
"anonymizeCustomerData",
"(",
"int",
"$",
"customerId",
",",
"\\",
"DateTime",
"$",
"delay",
"=",
"null",
")",
"{",
"// If delay is not null, apply this delay to the customer data.",
"if",
"(",
"$",
"delay",
"!==",
"null",
")",
"{",
"$",
"thi... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/Customer/TrackingService.php#L79-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/Customer/TrackingService.php | TrackingService.addCustomerLink | private function addCustomerLink($eventData)
{
// The customerId is set in session if the Magento_Persistent module is enabled and a persistent session exists.
if ($this->customerSession->getCustomerId() !== null) {
$customerId = $this->customerSession->getCustomerId();
$sess... | php | private function addCustomerLink($eventData)
{
// The customerId is set in session if the Magento_Persistent module is enabled and a persistent session exists.
if ($this->customerSession->getCustomerId() !== null) {
$customerId = $this->customerSession->getCustomerId();
$sess... | [
"private",
"function",
"addCustomerLink",
"(",
"$",
"eventData",
")",
"{",
"// The customerId is set in session if the Magento_Persistent module is enabled and a persistent session exists.",
"if",
"(",
"$",
"this",
"->",
"customerSession",
"->",
"getCustomerId",
"(",
")",
"!=="... | Save customer link if the current customer is logged in.
@param array $eventData Event | [
"Save",
"customer",
"link",
"if",
"the",
"current",
"customer",
"is",
"logged",
"in",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/Customer/TrackingService.php#L114-L138 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Observer/MoveVirtualCategoryRoot.php | MoveVirtualCategoryRoot.execute | public function execute(\Magento\Framework\Event\Observer $observer)
{
/** @var \Magento\Catalog\Model\Category $category The moved Category */
$category = $observer->getCategory();
/** @var \Magento\Catalog\Model\Category $newParent */
$newParent = $observer->getParent();
$... | php | public function execute(\Magento\Framework\Event\Observer $observer)
{
/** @var \Magento\Catalog\Model\Category $category The moved Category */
$category = $observer->getCategory();
/** @var \Magento\Catalog\Model\Category $newParent */
$newParent = $observer->getParent();
$... | [
"public",
"function",
"execute",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Event",
"\\",
"Observer",
"$",
"observer",
")",
"{",
"/** @var \\Magento\\Catalog\\Model\\Category $category The moved Category */",
"$",
"category",
"=",
"$",
"observer",
"->",
"getCategor... | Process validation of the move process of a category :
a category cannot be moved under a category using it as virtual root.
@event catalog_category_move_before
@param Observer $observer The observer
@throws \Magento\Framework\Exception\LocalizedException | [
"Process",
"validation",
"of",
"the",
"move",
"process",
"of",
"a",
"category",
":",
"a",
"category",
"cannot",
"be",
"moved",
"under",
"a",
"category",
"using",
"it",
"as",
"virtual",
"root",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Observer/MoveVirtualCategoryRoot.php#L65-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Observer/MoveVirtualCategoryRoot.php | MoveVirtualCategoryRoot.getNewParentTree | private function getNewParentTree($category)
{
$pathIds = array_reverse(explode(',', $category->getPathInStore()));
$pathIds[] = $category->getId();
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categories */
$categories = $this->categoryCollectionFactory->creat... | php | private function getNewParentTree($category)
{
$pathIds = array_reverse(explode(',', $category->getPathInStore()));
$pathIds[] = $category->getId();
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categories */
$categories = $this->categoryCollectionFactory->creat... | [
"private",
"function",
"getNewParentTree",
"(",
"$",
"category",
")",
"{",
"$",
"pathIds",
"=",
"array_reverse",
"(",
"explode",
"(",
"','",
",",
"$",
"category",
"->",
"getPathInStore",
"(",
")",
")",
")",
";",
"$",
"pathIds",
"[",
"]",
"=",
"$",
"cat... | Return parent categories of category
@param \Magento\Catalog\Model\Category $category The category
@return \Magento\Catalog\Model\ResourceModel\Category\Collection | [
"Return",
"parent",
"categories",
"of",
"category"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Observer/MoveVirtualCategoryRoot.php#L94-L105 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php | AggregationFactory.create | public function create(array $rawAggregations)
{
$buckets = $this->getBuckets($rawAggregations);
return $this->aggregationFactory->create(['buckets' => $buckets]);
} | php | public function create(array $rawAggregations)
{
$buckets = $this->getBuckets($rawAggregations);
return $this->aggregationFactory->create(['buckets' => $buckets]);
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"rawAggregations",
")",
"{",
"$",
"buckets",
"=",
"$",
"this",
"->",
"getBuckets",
"(",
"$",
"rawAggregations",
")",
";",
"return",
"$",
"this",
"->",
"aggregationFactory",
"->",
"create",
"(",
"[",
"'buck... | Build a aggregation object from the search engine response.
@param array $rawAggregations ES aggregations response.
@return \Magento\Framework\Search\Response\Aggregation | [
"Build",
"a",
"aggregation",
"object",
"from",
"the",
"search",
"engine",
"response",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php#L65-L70 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php | AggregationFactory.getBuckets | private function getBuckets($rawAggregations)
{
$buckets = [];
foreach ($rawAggregations as $bucketName => $rawBucket) {
while (isset($rawBucket[$bucketName])) {
$rawBucket = $rawBucket[$bucketName];
}
$bucketParams = ['name' => $bucketName, 'val... | php | private function getBuckets($rawAggregations)
{
$buckets = [];
foreach ($rawAggregations as $bucketName => $rawBucket) {
while (isset($rawBucket[$bucketName])) {
$rawBucket = $rawBucket[$bucketName];
}
$bucketParams = ['name' => $bucketName, 'val... | [
"private",
"function",
"getBuckets",
"(",
"$",
"rawAggregations",
")",
"{",
"$",
"buckets",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rawAggregations",
"as",
"$",
"bucketName",
"=>",
"$",
"rawBucket",
")",
"{",
"while",
"(",
"isset",
"(",
"$",
"rawBucket... | Return buckets from an ES aggregation.
@param array $rawAggregations ES aggregations.
@return \Magento\Framework\Search\Response\Bucket[] | [
"Return",
"buckets",
"from",
"an",
"ES",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php#L79-L93 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php | AggregationFactory.getBucketValues | private function getBucketValues($rawBucket)
{
$values = [];
if (isset($rawBucket['sum_other_doc_count']) && $rawBucket['sum_other_doc_count'] > 0) {
$rawBucket['buckets']['__other_docs']['doc_count'] = $rawBucket['sum_other_doc_count'];
}
foreach ($rawBucket['buckets']... | php | private function getBucketValues($rawBucket)
{
$values = [];
if (isset($rawBucket['sum_other_doc_count']) && $rawBucket['sum_other_doc_count'] > 0) {
$rawBucket['buckets']['__other_docs']['doc_count'] = $rawBucket['sum_other_doc_count'];
}
foreach ($rawBucket['buckets']... | [
"private",
"function",
"getBucketValues",
"(",
"$",
"rawBucket",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"rawBucket",
"[",
"'sum_other_doc_count'",
"]",
")",
"&&",
"$",
"rawBucket",
"[",
"'sum_other_doc_count'",
"]",
">",... | Return a bucket from an ES aggregation.
@param array $rawBucket ES bucket.
@return \Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\Aggregation\Value[] | [
"Return",
"a",
"bucket",
"from",
"an",
"ES",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php#L102-L134 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php | AggregationFactory.getMetrics | private function getMetrics($rawValue)
{
$metrics = [];
foreach ($rawValue as $metricName => $value) {
if (!is_array($value) || !isset($value['buckets'])) {
$metricName = $metricName == 'doc_count' ? 'count' : $metricName;
if (is_array($value) && isset($v... | php | private function getMetrics($rawValue)
{
$metrics = [];
foreach ($rawValue as $metricName => $value) {
if (!is_array($value) || !isset($value['buckets'])) {
$metricName = $metricName == 'doc_count' ? 'count' : $metricName;
if (is_array($value) && isset($v... | [
"private",
"function",
"getMetrics",
"(",
"$",
"rawValue",
")",
"{",
"$",
"metrics",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rawValue",
"as",
"$",
"metricName",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
"||... | Parse a bucket and returns metrics.
@param array $rawValue Bucket data.
@return mixed | [
"Parse",
"a",
"bucket",
"and",
"returns",
"metrics",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php#L143-L160 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php | AggregationFactory.getSubAggregations | private function getSubAggregations($rawValue)
{
$subAggregations = [];
foreach ($rawValue as $key => $value) {
if (is_array($value)) {
while (is_array($value) && isset($value[$key]) && is_array($value[$key])) {
$value = $value[$key];
... | php | private function getSubAggregations($rawValue)
{
$subAggregations = [];
foreach ($rawValue as $key => $value) {
if (is_array($value)) {
while (is_array($value) && isset($value[$key]) && is_array($value[$key])) {
$value = $value[$key];
... | [
"private",
"function",
"getSubAggregations",
"(",
"$",
"rawValue",
")",
"{",
"$",
"subAggregations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"rawValue",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"... | Parse a bucket and returns sub-aggregations.
@param array $rawValue Bucket data.
@return \Magento\Framework\Search\Response\Aggregation | [
"Parse",
"a",
"bucket",
"and",
"returns",
"sub",
"-",
"aggregations",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/AggregationFactory.php#L169-L186 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.create | public function create($storeId, $containerName)
{
$scopeCode = $this->getScopeCode($storeId, $containerName);
if (!isset($this->cachedConfig[$scopeCode])) {
$instanceConfiguration = $this->loadConfiguration($scopeCode);
$this->cachedConfig[$scopeCode] = $this->obje... | php | public function create($storeId, $containerName)
{
$scopeCode = $this->getScopeCode($storeId, $containerName);
if (!isset($this->cachedConfig[$scopeCode])) {
$instanceConfiguration = $this->loadConfiguration($scopeCode);
$this->cachedConfig[$scopeCode] = $this->obje... | [
"public",
"function",
"create",
"(",
"$",
"storeId",
",",
"$",
"containerName",
")",
"{",
"$",
"scopeCode",
"=",
"$",
"this",
"->",
"getScopeCode",
"(",
"$",
"storeId",
",",
"$",
"containerName",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"... | Retrieve relevance configuration for a container.
@param int $storeId Store id.
@param string $containerName Container identifier.
@return \Smile\ElasticsuiteCore\Api\Search\Request\Container\RelevanceConfigurationInterface | [
"Retrieve",
"relevance",
"configuration",
"for",
"a",
"container",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L109-L119 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.loadConfiguration | protected function loadConfiguration($scopeCode)
{
$configurationParams = [
'minimumShouldMatch' => $this->getMinimumShouldMatch($scopeCode),
'tieBreaker' => $this->getTieBreaker($scopeCode),
'phraseMatchBoost' => $this->getPhraseMatchBoostConfiguration($s... | php | protected function loadConfiguration($scopeCode)
{
$configurationParams = [
'minimumShouldMatch' => $this->getMinimumShouldMatch($scopeCode),
'tieBreaker' => $this->getTieBreaker($scopeCode),
'phraseMatchBoost' => $this->getPhraseMatchBoostConfiguration($s... | [
"protected",
"function",
"loadConfiguration",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"configurationParams",
"=",
"[",
"'minimumShouldMatch'",
"=>",
"$",
"this",
"->",
"getMinimumShouldMatch",
"(",
"$",
"scopeCode",
")",
",",
"'tieBreaker'",
"=>",
"$",
"this",
"->... | Load the relevance configuration by scope code.
@param string $scopeCode Container scope code.
@return array | [
"Load",
"the",
"relevance",
"configuration",
"by",
"scope",
"code",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L128-L140 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getConfigValue | protected function getConfigValue($path, $scopeCode)
{
$scope = ContainerScopeInterface::SCOPE_STORE_CONTAINERS;
return $this->scopeConfig->getValue($path, $scope, $scopeCode);
} | php | protected function getConfigValue($path, $scopeCode)
{
$scope = ContainerScopeInterface::SCOPE_STORE_CONTAINERS;
return $this->scopeConfig->getValue($path, $scope, $scopeCode);
} | [
"protected",
"function",
"getConfigValue",
"(",
"$",
"path",
",",
"$",
"scopeCode",
")",
"{",
"$",
"scope",
"=",
"ContainerScopeInterface",
"::",
"SCOPE_STORE_CONTAINERS",
";",
"return",
"$",
"this",
"->",
"scopeConfig",
"->",
"getValue",
"(",
"$",
"path",
","... | Read value into the config by path and scope.
@param string $path Config path.
@param string $scopeCode Scope coode.
@return mixed | [
"Read",
"value",
"into",
"the",
"config",
"by",
"path",
"and",
"scope",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L150-L155 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getFuzzinessConfiguration | private function getFuzzinessConfiguration($scopeCode)
{
$path = self::FUZZINESS_CONFIG_XML_PREFIX;
$configuration = (bool) $this->getConfigValue($path . "/enable", $scopeCode);
if ($configuration === true) {
$configurationParams = [
'value' => $this->get... | php | private function getFuzzinessConfiguration($scopeCode)
{
$path = self::FUZZINESS_CONFIG_XML_PREFIX;
$configuration = (bool) $this->getConfigValue($path . "/enable", $scopeCode);
if ($configuration === true) {
$configurationParams = [
'value' => $this->get... | [
"private",
"function",
"getFuzzinessConfiguration",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"FUZZINESS_CONFIG_XML_PREFIX",
";",
"$",
"configuration",
"=",
"(",
"bool",
")",
"$",
"this",
"->",
"getConfigValue",
"(",
"$",
"path",
".",
... | Retrieve fuzziness configuration object.
@param string $scopeCode The scope code.
@return FuzzinessConfigurationInterface|null | [
"Retrieve",
"fuzziness",
"configuration",
"object",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L164-L181 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getPhraseMatchBoostConfiguration | private function getPhraseMatchBoostConfiguration($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::PHRASE_MATCH_CONFIG_XML_PREFIX;
$boost = (bool) $this->getConfigValue($path . "/enable_phrase_match", $scopeCode);
if ($boost === true) {
$boost = (int) ... | php | private function getPhraseMatchBoostConfiguration($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::PHRASE_MATCH_CONFIG_XML_PREFIX;
$boost = (bool) $this->getConfigValue($path . "/enable_phrase_match", $scopeCode);
if ($boost === true) {
$boost = (int) ... | [
"private",
"function",
"getPhraseMatchBoostConfiguration",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"BASE_RELEVANCE_CONFIG_XML_PREFIX",
".",
"\"/\"",
".",
"self",
"::",
"PHRASE_MATCH_CONFIG_XML_PREFIX",
";",
"$",
"boost",
"=",
"(",
"bool",
... | Retrieve phrase boost configuration for a container.
@param string $scopeCode The scope code
@return bool|int | [
"Retrieve",
"phrase",
"boost",
"configuration",
"for",
"a",
"container",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L217-L228 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getMinimumShouldMatch | private function getMinimumShouldMatch($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::MINIMUM_SHOULD_MATCH_CONFIG_XML_PATH;
return $this->getConfigValue($path, $scopeCode);
} | php | private function getMinimumShouldMatch($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::MINIMUM_SHOULD_MATCH_CONFIG_XML_PATH;
return $this->getConfigValue($path, $scopeCode);
} | [
"private",
"function",
"getMinimumShouldMatch",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"BASE_RELEVANCE_CONFIG_XML_PREFIX",
".",
"\"/\"",
".",
"self",
"::",
"MINIMUM_SHOULD_MATCH_CONFIG_XML_PATH",
";",
"return",
"$",
"this",
"->",
"getConfig... | Retrieve minimum should match config for a container.
@param string $scopeCode The scope code.
@return string | [
"Retrieve",
"minimum",
"should",
"match",
"config",
"for",
"a",
"container",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L237-L242 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getTieBreaker | private function getTieBreaker($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::TIE_BREAKER_CONFIG_XML_PATH;
return (float) $this->getConfigValue($path, $scopeCode);
} | php | private function getTieBreaker($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::TIE_BREAKER_CONFIG_XML_PATH;
return (float) $this->getConfigValue($path, $scopeCode);
} | [
"private",
"function",
"getTieBreaker",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"BASE_RELEVANCE_CONFIG_XML_PREFIX",
".",
"\"/\"",
".",
"self",
"::",
"TIE_BREAKER_CONFIG_XML_PATH",
";",
"return",
"(",
"float",
")",
"$",
"this",
"->",
"g... | Retrieve tie breaker config for a container.
@param string $scopeCode The scope code.
@return float | [
"Retrieve",
"tie",
"breaker",
"config",
"for",
"a",
"container",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L251-L256 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php | Factory.getCutoffFrequencyConfiguration | private function getCutoffFrequencyConfiguration($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::CUTOFF_FREQUENCY_CONFIG_XML_PATH;
return (float) $this->getConfigValue($path, $scopeCode);
} | php | private function getCutoffFrequencyConfiguration($scopeCode)
{
$path = self::BASE_RELEVANCE_CONFIG_XML_PREFIX . "/" . self::CUTOFF_FREQUENCY_CONFIG_XML_PATH;
return (float) $this->getConfigValue($path, $scopeCode);
} | [
"private",
"function",
"getCutoffFrequencyConfiguration",
"(",
"$",
"scopeCode",
")",
"{",
"$",
"path",
"=",
"self",
"::",
"BASE_RELEVANCE_CONFIG_XML_PREFIX",
".",
"\"/\"",
".",
"self",
"::",
"CUTOFF_FREQUENCY_CONFIG_XML_PATH",
";",
"return",
"(",
"float",
")",
"$",... | Retrieve cutoff frequency for a container.
@param string $scopeCode The scope code.
@return float | [
"Retrieve",
"cutoff",
"frequency",
"for",
"a",
"container",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/ContainerConfiguration/RelevanceConfig/Factory.php#L265-L270 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Setup/InstallSchema.php | InstallSchema.install | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->coreSetup->createRelevanceConfigTable($setup);
$setup->endSetup();
} | php | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->coreSetup->createRelevanceConfigTable($setup);
$setup->endSetup();
} | [
"public",
"function",
"install",
"(",
"SchemaSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"this",
"->",
"coreSetup",
"->",
"createRelevanceConfigTable",
"(",
"$",
... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Installs DB schema for a module
@param SchemaSetupInterface $setup The setup interface
@param ModuleContextInterface $context The module Context
@return void | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"UnusedFormalParameter",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Setup/InstallSchema.php#L56-L63 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Setup/UpgradeData.php | UpgradeData.upgrade | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), '1.1.0', '<')) {
$this->virtualCategorySetup->updateVirtualCategoryRootTypeToInt($this->eavSetupFactory->create(['setup' => $setu... | php | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), '1.1.0', '<')) {
$this->virtualCategorySetup->updateVirtualCategoryRootTypeToInt($this->eavSetupFactory->create(['setup' => $setu... | [
"public",
"function",
"upgrade",
"(",
"ModuleDataSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"if",
"(",
"version_compare",
"(",
"$",
"context",
"->",
"getVersion",
"("... | Upgrade the module data.
@param ModuleDataSetupInterface $setup The setup interface
@param ModuleContextInterface $context The module Context
@return void | [
"Upgrade",
"the",
"module",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Setup/UpgradeData.php#L64-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/QueryGroup.php | QueryGroup.buildBucket | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_QUERY_GROUP) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$filters = [];
foreach ($bucket->getQueries... | php | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_QUERY_GROUP) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$filters = [];
foreach ($bucket->getQueries... | [
"public",
"function",
"buildBucket",
"(",
"BucketInterface",
"$",
"bucket",
")",
"{",
"if",
"(",
"$",
"bucket",
"->",
"getType",
"(",
")",
"!==",
"BucketInterface",
"::",
"TYPE_QUERY_GROUP",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Q... | Build the aggregation.
@param BucketInterface $bucket Term bucket.
@return array | [
"Build",
"the",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/QueryGroup.php#L52-L65 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/SessionIndex.php | SessionIndex.indexEvents | public function indexEvents($events)
{
$sessionIdsByStore = $this->getSessionIdsByStore($events);
$bulk = $this->indexOperation->createBulk();
$indices = [];
foreach ($sessionIdsByStore as $storeId => $sessionIds) {
$sessionData = $this->resourceMo... | php | public function indexEvents($events)
{
$sessionIdsByStore = $this->getSessionIdsByStore($events);
$bulk = $this->indexOperation->createBulk();
$indices = [];
foreach ($sessionIdsByStore as $storeId => $sessionIds) {
$sessionData = $this->resourceMo... | [
"public",
"function",
"indexEvents",
"(",
"$",
"events",
")",
"{",
"$",
"sessionIdsByStore",
"=",
"$",
"this",
"->",
"getSessionIdsByStore",
"(",
"$",
"events",
")",
";",
"$",
"bulk",
"=",
"$",
"this",
"->",
"indexOperation",
"->",
"createBulk",
"(",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/SessionIndex.php#L71-L98 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/SessionIndex.php | SessionIndex.getSessionIdsByStore | private function getSessionIdsByStore($events)
{
$sessionIdsByStore = [];
foreach ($events as $event) {
if (isset($event['page']['store_id']) && isset($event['session']['uid'])) {
$sessionIdsByStore[$event['page']['store_id']][] = $event['session']['uid'] ?? 0;
... | php | private function getSessionIdsByStore($events)
{
$sessionIdsByStore = [];
foreach ($events as $event) {
if (isset($event['page']['store_id']) && isset($event['session']['uid'])) {
$sessionIdsByStore[$event['page']['store_id']][] = $event['session']['uid'] ?? 0;
... | [
"private",
"function",
"getSessionIdsByStore",
"(",
"$",
"events",
")",
"{",
"$",
"sessionIdsByStore",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"events",
"as",
"$",
"event",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"event",
"[",
"'page'",
"]",
"[",
"'... | Extract session ids from event by store.
@param array $events Events
@return array | [
"Extract",
"session",
"ids",
"from",
"event",
"by",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/SessionIndex.php#L107-L118 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.getProperties | public function getProperties()
{
$properties = [];
foreach ($this->defaultMappingFields as $fieldName => $analyzers) {
$properties = $this->addProperty($properties, $fieldName, FieldInterface::FIELD_TYPE_TEXT, $analyzers);
}
foreach ($this->getFields() as $currentField... | php | public function getProperties()
{
$properties = [];
foreach ($this->defaultMappingFields as $fieldName => $analyzers) {
$properties = $this->addProperty($properties, $fieldName, FieldInterface::FIELD_TYPE_TEXT, $analyzers);
}
foreach ($this->getFields() as $currentField... | [
"public",
"function",
"getProperties",
"(",
")",
"{",
"$",
"properties",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"defaultMappingFields",
"as",
"$",
"fieldName",
"=>",
"$",
"analyzers",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L104-L117 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.getField | public function getField($name)
{
if (!isset($this->fields[$name])) {
throw new \LogicException("Field {$name} does not exists in mapping");
}
return $this->fields[$name];
} | php | public function getField($name)
{
if (!isset($this->fields[$name])) {
throw new \LogicException("Field {$name} does not exists in mapping");
}
return $this->fields[$name];
} | [
"public",
"function",
"getField",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"fields",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"Field {$name} does not exists in mapping\"",
")",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L130-L137 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.getWeightedSearchProperties | public function getWeightedSearchProperties(
$analyzer = null,
$defaultField = null,
$boost = 1,
FieldFilterInterface $fieldFilter = null
) {
$weightedFields = [];
$fields = $this->getFields();
if ($defaultField) {
$defaultSearchProperty =... | php | public function getWeightedSearchProperties(
$analyzer = null,
$defaultField = null,
$boost = 1,
FieldFilterInterface $fieldFilter = null
) {
$weightedFields = [];
$fields = $this->getFields();
if ($defaultField) {
$defaultSearchProperty =... | [
"public",
"function",
"getWeightedSearchProperties",
"(",
"$",
"analyzer",
"=",
"null",
",",
"$",
"defaultField",
"=",
"null",
",",
"$",
"boost",
"=",
"1",
",",
"FieldFilterInterface",
"$",
"fieldFilter",
"=",
"null",
")",
"{",
"$",
"weightedFields",
"=",
"[... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L150-L185 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.getDefaultSearchProperty | private function getDefaultSearchProperty($field = self::DEFAULT_SEARCH_FIELD, $analyzer = null)
{
if (!isset($this->defaultMappingFields[$field])) {
throw new \InvalidArgumentException("Unable to find field {$field}.");
}
$property = $field;
if ($analyzer !== null) {
... | php | private function getDefaultSearchProperty($field = self::DEFAULT_SEARCH_FIELD, $analyzer = null)
{
if (!isset($this->defaultMappingFields[$field])) {
throw new \InvalidArgumentException("Unable to find field {$field}.");
}
$property = $field;
if ($analyzer !== null) {
... | [
"private",
"function",
"getDefaultSearchProperty",
"(",
"$",
"field",
"=",
"self",
"::",
"DEFAULT_SEARCH_FIELD",
",",
"$",
"analyzer",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"defaultMappingFields",
"[",
"$",
"field",
"]",
"... | Return the search property for a field present in defaultMappingFields.
@throws \InvalidArgumentException If the field / analyzer does not exists.
@param string $field Field.
@param string $analyzer Required analyzer.
@return string | [
"Return",
"the",
"search",
"property",
"for",
"a",
"field",
"present",
"in",
"defaultMappingFields",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L197-L214 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.prepareFields | private function prepareFields(array $fields)
{
$preparedFields = [];
foreach ($fields as $field) {
$preparedFields[$field->getName()] = $field;
}
return $preparedFields;
} | php | private function prepareFields(array $fields)
{
$preparedFields = [];
foreach ($fields as $field) {
$preparedFields[$field->getName()] = $field;
}
return $preparedFields;
} | [
"private",
"function",
"prepareFields",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"preparedFields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"$",
"preparedFields",
"[",
"$",
"field",
"->",
"getName",
"(",
")",
... | Prepare the array of fields to be added to the mapping. Mostly rekey the array.
@param array $fields Fields to be prepared.
@return FieldInterface[] | [
"Prepare",
"the",
"array",
"of",
"fields",
"to",
"be",
"added",
"to",
"the",
"mapping",
".",
"Mostly",
"rekey",
"the",
"array",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L223-L232 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.addProperty | private function addProperty(array $properties, $propertyName, $propertyType, $analyzers = [])
{
$property = ['type' => $propertyType, 'analyzer' => FieldInterface::ANALYZER_STANDARD];
foreach ($analyzers as $analyzer) {
if ($analyzer !== FieldInterface::ANALYZER_STANDARD) {
... | php | private function addProperty(array $properties, $propertyName, $propertyType, $analyzers = [])
{
$property = ['type' => $propertyType, 'analyzer' => FieldInterface::ANALYZER_STANDARD];
foreach ($analyzers as $analyzer) {
if ($analyzer !== FieldInterface::ANALYZER_STANDARD) {
... | [
"private",
"function",
"addProperty",
"(",
"array",
"$",
"properties",
",",
"$",
"propertyName",
",",
"$",
"propertyType",
",",
"$",
"analyzers",
"=",
"[",
"]",
")",
"{",
"$",
"property",
"=",
"[",
"'type'",
"=>",
"$",
"propertyType",
",",
"'analyzer'",
... | Append a new properties into a properties list and returned the updated map.
@param array $properties Initial properties list.
@param string $propertyName New property name.
@param string $propertyType New property type.
@param array $analyzers Property analyzers.
@return array | [
"Append",
"a",
"new",
"properties",
"into",
"a",
"properties",
"list",
"and",
"returned",
"the",
"updated",
"map",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L244-L257 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.addField | private function addField(array $properties, FieldInterface $field)
{
$fieldName = $field->getName();
$fieldRoot = &$properties;
// Read property config from the field.
$property = $field->getMappingPropertyConfig();
$fieldPathArray = explode('.', $fieldName);
$cu... | php | private function addField(array $properties, FieldInterface $field)
{
$fieldName = $field->getName();
$fieldRoot = &$properties;
// Read property config from the field.
$property = $field->getMappingPropertyConfig();
$fieldPathArray = explode('.', $fieldName);
$cu... | [
"private",
"function",
"addField",
"(",
"array",
"$",
"properties",
",",
"FieldInterface",
"$",
"field",
")",
"{",
"$",
"fieldName",
"=",
"$",
"field",
"->",
"getName",
"(",
")",
";",
"$",
"fieldRoot",
"=",
"&",
"$",
"properties",
";",
"// Read property co... | Append a field to a mapping properties list.
The field is append and the new properties list is returned.
@param array $properties Initial properties map.
@param FieldInterface $field Field to be added.
@return array | [
"Append",
"a",
"field",
"to",
"a",
"mapping",
"properties",
"list",
".",
"The",
"field",
"is",
"append",
"and",
"the",
"new",
"properties",
"list",
"is",
"returned",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L268-L308 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping.php | Mapping.getFieldCopyToProperties | private function getFieldCopyToProperties(FieldInterface $field)
{
$copyTo = [];
foreach ($this->copyFieldMap as $method => $targetField) {
if ($field->$method()) {
$copyTo[] = $targetField;
}
}
return $copyTo;
} | php | private function getFieldCopyToProperties(FieldInterface $field)
{
$copyTo = [];
foreach ($this->copyFieldMap as $method => $targetField) {
if ($field->$method()) {
$copyTo[] = $targetField;
}
}
return $copyTo;
} | [
"private",
"function",
"getFieldCopyToProperties",
"(",
"FieldInterface",
"$",
"field",
")",
"{",
"$",
"copyTo",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"copyFieldMap",
"as",
"$",
"method",
"=>",
"$",
"targetField",
")",
"{",
"if",
"(",
"$... | Get the list of default fields where the current field must be copied.
Example : searchable fields are copied into the default "search" field.
@param FieldInterface $field Field to be checked.
@return array | [
"Get",
"the",
"list",
"of",
"default",
"fields",
"where",
"the",
"current",
"field",
"must",
"be",
"copied",
".",
"Example",
":",
"searchable",
"fields",
"are",
"copied",
"into",
"the",
"default",
"search",
"field",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping.php#L318-L329 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.loadChildrens | public function loadChildrens($productIds, $storeId)
{
$children = [];
foreach ($this->catalogProductType->getCompositeTypes() as $productTypeId) {
$typeInstance = $this->getProductTypeInstance($productTypeId);
$relation = $typeInstance->getRelationInfo();
if ($... | php | public function loadChildrens($productIds, $storeId)
{
$children = [];
foreach ($this->catalogProductType->getCompositeTypes() as $productTypeId) {
$typeInstance = $this->getProductTypeInstance($productTypeId);
$relation = $typeInstance->getRelationInfo();
if ($... | [
"public",
"function",
"loadChildrens",
"(",
"$",
"productIds",
",",
"$",
"storeId",
")",
"{",
"$",
"children",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"catalogProductType",
"->",
"getCompositeTypes",
"(",
")",
"as",
"$",
"productTypeId",
")"... | Retrieve list of children ids for a product list.
Warning the result use children ids as a key and list of parents as value
@param array $productIds List of parent product ids.
@param int $storeId Store id.
@return array | [
"Retrieve",
"list",
"of",
"children",
"ids",
"for",
"a",
"product",
"list",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L90-L117 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.addIndexedFilterToAttributeCollection | public function addIndexedFilterToAttributeCollection(
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection $attributeCollection
) {
$attributeCollection = parent::addIndexedFilterToAttributeCollection($attributeCollection);
$attributeCollection->getSelect()->orWhere("attribute_code... | php | public function addIndexedFilterToAttributeCollection(
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection $attributeCollection
) {
$attributeCollection = parent::addIndexedFilterToAttributeCollection($attributeCollection);
$attributeCollection->getSelect()->orWhere("attribute_code... | [
"public",
"function",
"addIndexedFilterToAttributeCollection",
"(",
"\\",
"Magento",
"\\",
"Eav",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Entity",
"\\",
"Attribute",
"\\",
"Collection",
"$",
"attributeCollection",
")",
"{",
"$",
"attributeCollection",
"=",
"par... | Allow to filter an attribute collection on attributes that are indexed into the search engine.
Inherited to enforce "status" and "sku" attribute indexing for products.
@param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection $attributeCollection Attribute Collection
@return \Magento\Eav\Model\ResourceMode... | [
"Allow",
"to",
"filter",
"an",
"attribute",
"collection",
"on",
"attributes",
"that",
"are",
"indexed",
"into",
"the",
"search",
"engine",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L128-L136 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.getProductEmulator | protected function getProductEmulator($typeId)
{
if (!isset($this->productEmulators[$typeId])) {
$productEmulator = new \Magento\Framework\DataObject();
$productEmulator->setTypeId($typeId);
$this->productEmulators[$typeId] = $productEmulator;
}
return $t... | php | protected function getProductEmulator($typeId)
{
if (!isset($this->productEmulators[$typeId])) {
$productEmulator = new \Magento\Framework\DataObject();
$productEmulator->setTypeId($typeId);
$this->productEmulators[$typeId] = $productEmulator;
}
return $t... | [
"protected",
"function",
"getProductEmulator",
"(",
"$",
"typeId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"productEmulators",
"[",
"$",
"typeId",
"]",
")",
")",
"{",
"$",
"productEmulator",
"=",
"new",
"\\",
"Magento",
"\\",
"Framewor... | Retrieve Product Emulator (Magento Object) by type identifier.
@param string $typeId Type identifier.
@return \Magento\Framework\DataObject | [
"Retrieve",
"Product",
"Emulator",
"(",
"Magento",
"Object",
")",
"by",
"type",
"identifier",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L145-L154 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.getProductTypeInstance | protected function getProductTypeInstance($typeId)
{
if (!isset($this->productTypes[$typeId])) {
$productEmulator = $this->getProductEmulator($typeId);
$this->productTypes[$typeId] = $this->catalogProductType->factory($productEmulator);
}
return $this->productTypes[... | php | protected function getProductTypeInstance($typeId)
{
if (!isset($this->productTypes[$typeId])) {
$productEmulator = $this->getProductEmulator($typeId);
$this->productTypes[$typeId] = $this->catalogProductType->factory($productEmulator);
}
return $this->productTypes[... | [
"protected",
"function",
"getProductTypeInstance",
"(",
"$",
"typeId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"productTypes",
"[",
"$",
"typeId",
"]",
")",
")",
"{",
"$",
"productEmulator",
"=",
"$",
"this",
"->",
"getProductEmulator",
... | Retrieve product type instance from identifier.
@param string $typeId Type identifier.
@return \Magento\Catalog\Model\Product\Type\AbstractType | [
"Retrieve",
"product",
"type",
"instance",
"from",
"identifier",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L163-L172 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.getRelationQuery | private function getRelationQuery($relation, $parentIds, $storeId)
{
$linkField = $this->getEntityMetaData($this->getEntityTypeId())->getLinkField();
$entityIdField = $this->getEntityMetaData($this->getEntityTypeId())->getIdentifierField();
$entityTable = $this->getTable($this->g... | php | private function getRelationQuery($relation, $parentIds, $storeId)
{
$linkField = $this->getEntityMetaData($this->getEntityTypeId())->getLinkField();
$entityIdField = $this->getEntityMetaData($this->getEntityTypeId())->getIdentifierField();
$entityTable = $this->getTable($this->g... | [
"private",
"function",
"getRelationQuery",
"(",
"$",
"relation",
",",
"$",
"parentIds",
",",
"$",
"storeId",
")",
"{",
"$",
"linkField",
"=",
"$",
"this",
"->",
"getEntityMetaData",
"(",
"$",
"this",
"->",
"getEntityTypeId",
"(",
")",
")",
"->",
"getLinkFi... | Retrieve
@param \Magento\Framework\DataObject $relation Relation Instance
@param array $parentIds The parent product Ids (array of entity_id)
@param int $storeId Store id.
@return \Magento\Framework\DB\Select | [
"Retrieve"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L193-L232 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.addWebsiteFilter | private function addWebsiteFilter(\Magento\Framework\DB\Select $select, $productTableName, $productFieldName, $storeId)
{
$websiteId = $this->getStore($storeId)->getWebsiteId();
$indexTable = $this->getTable('catalog_product_website');
$visibilityJoinCond = $this->getConnection()->quoteInt... | php | private function addWebsiteFilter(\Magento\Framework\DB\Select $select, $productTableName, $productFieldName, $storeId)
{
$websiteId = $this->getStore($storeId)->getWebsiteId();
$indexTable = $this->getTable('catalog_product_website');
$visibilityJoinCond = $this->getConnection()->quoteInt... | [
"private",
"function",
"addWebsiteFilter",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"DB",
"\\",
"Select",
"$",
"select",
",",
"$",
"productTableName",
",",
"$",
"productFieldName",
",",
"$",
"storeId",
")",
"{",
"$",
"websiteId",
"=",
"$",
"this",
"-... | Add website clauses to products selected.
@param \Magento\Framework\DB\Select $select Original select.
@param string $productTableName Product table name in the original select.
@param string $productFieldName Product id field name in the original select.
@param in... | [
"Add",
"website",
"clauses",
"to",
"products",
"selected",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/AttributeData.php#L244-L257 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/SearchTerms.php | SearchTerms.modifyData | public function modifyData(array $data)
{
$optimizer = $this->locator->getOptimizer();
if ($optimizer && $optimizer->getId() && isset($data[$optimizer->getId()])) {
if (isset($data[$optimizer->getId()]['quick_search_container'])
&& isset($data[$optimizer->getId()]['quick... | php | public function modifyData(array $data)
{
$optimizer = $this->locator->getOptimizer();
if ($optimizer && $optimizer->getId() && isset($data[$optimizer->getId()])) {
if (isset($data[$optimizer->getId()]['quick_search_container'])
&& isset($data[$optimizer->getId()]['quick... | [
"public",
"function",
"modifyData",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"optimizer",
"=",
"$",
"this",
"->",
"locator",
"->",
"getOptimizer",
"(",
")",
";",
"if",
"(",
"$",
"optimizer",
"&&",
"$",
"optimizer",
"->",
"getId",
"(",
")",
"&&",
"is... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/SearchTerms.php#L62-L77 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/SearchTerms.php | SearchTerms.fillQueryData | private function fillQueryData($queryIds)
{
$data = [];
$collection = $this->queryCollection->addFieldToFilter('query_id', $queryIds);
$yesNoValues = $this->yesNo->toArray();
foreach ($collection as $query) {
$data[] = [
'id' => $query->get... | php | private function fillQueryData($queryIds)
{
$data = [];
$collection = $this->queryCollection->addFieldToFilter('query_id', $queryIds);
$yesNoValues = $this->yesNo->toArray();
foreach ($collection as $query) {
$data[] = [
'id' => $query->get... | [
"private",
"function",
"fillQueryData",
"(",
"$",
"queryIds",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"collection",
"=",
"$",
"this",
"->",
"queryCollection",
"->",
"addFieldToFilter",
"(",
"'query_id'",
",",
"$",
"queryIds",
")",
";",
"$",
"yesN... | Get query data to fill the dynamicRows in Ui Component Form.
@param integer[] $queryIds The query ids
@return array | [
"Get",
"query",
"data",
"to",
"fill",
"the",
"dynamicRows",
"in",
"Ui",
"Component",
"Form",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Ui/Component/Optimizer/Form/Modifier/SearchTerms.php#L94-L110 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches.php | Swatches.canRenderFilter | protected function canRenderFilter()
{
$canRenderFilter = false;
try {
$attribute = $this->getFilter()->getAttributeModel();
$canRenderFilter = $this->swatchHelper->isSwatchAttribute($attribute);
} catch (\Exception $e) {
;
}
return $canRe... | php | protected function canRenderFilter()
{
$canRenderFilter = false;
try {
$attribute = $this->getFilter()->getAttributeModel();
$canRenderFilter = $this->swatchHelper->isSwatchAttribute($attribute);
} catch (\Exception $e) {
;
}
return $canRe... | [
"protected",
"function",
"canRenderFilter",
"(",
")",
"{",
"$",
"canRenderFilter",
"=",
"false",
";",
"try",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getAttributeModel",
"(",
")",
";",
"$",
"canRenderFilter",
"=",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches.php#L57-L68 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches.php | Swatches._toHtml | protected function _toHtml()
{
$html = false;
if ($this->canRenderFilter()) {
$html = $this->getLayout()
->createBlock($this->block)
->setSwatchFilter($this->getFilter())
->toHtml();
}
return $html;
} | php | protected function _toHtml()
{
$html = false;
if ($this->canRenderFilter()) {
$html = $this->getLayout()
->createBlock($this->block)
->setSwatchFilter($this->getFilter())
->toHtml();
}
return $html;
} | [
"protected",
"function",
"_toHtml",
"(",
")",
"{",
"$",
"html",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"canRenderFilter",
"(",
")",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"getLayout",
"(",
")",
"->",
"createBlock",
"(",
"$",
"this... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Block/Navigation/Renderer/Swatches.php#L75-L87 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/SignificantTerm.php | SignificantTerm.buildBucket | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_SIGNIFICANT_TERM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggrepationParams = [
'field' ... | php | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_SIGNIFICANT_TERM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggrepationParams = [
'field' ... | [
"public",
"function",
"buildBucket",
"(",
"BucketInterface",
"$",
"bucket",
")",
"{",
"if",
"(",
"$",
"bucket",
"->",
"getType",
"(",
")",
"!==",
"BucketInterface",
"::",
"TYPE_SIGNIFICANT_TERM",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
... | Build the aggregation.
@param BucketInterface $bucket Term bucket.
@return array | [
"Build",
"the",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/SignificantTerm.php#L36-L49 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig/Data/Collection/Scoped.php | Scoped._initSelect | protected function _initSelect()
{
parent::_initSelect();
$this->addFieldToSelect(['path', 'value'])->addFieldToFilter('scope', $this->scope);
if ($this->scopeCode !== null) {
$this->addFieldToFilter('scope_code', $this->scopeCode);
}
return $this;
} | php | protected function _initSelect()
{
parent::_initSelect();
$this->addFieldToSelect(['path', 'value'])->addFieldToFilter('scope', $this->scope);
if ($this->scopeCode !== null) {
$this->addFieldToFilter('scope_code', $this->scopeCode);
}
return $this;
} | [
"protected",
"function",
"_initSelect",
"(",
")",
"{",
"parent",
"::",
"_initSelect",
"(",
")",
";",
"$",
"this",
"->",
"addFieldToSelect",
"(",
"[",
"'path'",
",",
"'value'",
"]",
")",
"->",
"addFieldToFilter",
"(",
"'scope'",
",",
"$",
"this",
"->",
"s... | Initialize select
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return $this | [
"Initialize",
"select"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/ResourceModel/Search/Request/RelevanceConfig/Data/Collection/Scoped.php#L79-L89 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Search/Request/Product/Coverage/Aggregation/Resolver.php | Resolver.getContainerAggregations | public function getContainerAggregations(
ContainerConfigurationInterface $containerConfig,
$query = null,
$filters = [],
$queryFilters = []
) {
return [
['name' => 'attribute_set_id', 'type' => BucketInterface::TYPE_TERM, 'size' => 0],
['name' => 'ind... | php | public function getContainerAggregations(
ContainerConfigurationInterface $containerConfig,
$query = null,
$filters = [],
$queryFilters = []
) {
return [
['name' => 'attribute_set_id', 'type' => BucketInterface::TYPE_TERM, 'size' => 0],
['name' => 'ind... | [
"public",
"function",
"getContainerAggregations",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"query",
"=",
"null",
",",
"$",
"filters",
"=",
"[",
"]",
",",
"$",
"queryFilters",
"=",
"[",
"]",
")",
"{",
"return",
"[",
"[",
"'nam... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Search/Request/Product/Coverage/Aggregation/Resolver.php#L33-L43 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Action/Full.php | Full.rebuildStoreIndex | public function rebuildStoreIndex($storeId, $categoryIds = null)
{
$lastCategoryId = 0;
do {
$categories = $this->getSearchableCategories($storeId, $categoryIds, $lastCategoryId);
foreach ($categories as $categoryData) {
$lastCategoryId = (int) $categoryData... | php | public function rebuildStoreIndex($storeId, $categoryIds = null)
{
$lastCategoryId = 0;
do {
$categories = $this->getSearchableCategories($storeId, $categoryIds, $lastCategoryId);
foreach ($categories as $categoryData) {
$lastCategoryId = (int) $categoryData... | [
"public",
"function",
"rebuildStoreIndex",
"(",
"$",
"storeId",
",",
"$",
"categoryIds",
"=",
"null",
")",
"{",
"$",
"lastCategoryId",
"=",
"0",
";",
"do",
"{",
"$",
"categories",
"=",
"$",
"this",
"->",
"getSearchableCategories",
"(",
"$",
"storeId",
",",... | Get data for a list of categories in a store id.
If the product list ids is null, all categories data will be loaded.
@param integer $storeId Store id.
@param array|null $categoryIds List of category ids.
@return \Traversable | [
"Get",
"data",
"for",
"a",
"list",
"of",
"categories",
"in",
"a",
"store",
"id",
".",
"If",
"the",
"product",
"list",
"ids",
"is",
"null",
"all",
"categories",
"data",
"will",
"be",
"loaded",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Action/Full.php#L51-L63 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Action/Full.php | Full.getSearchableCategories | private function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
{
return $this->resourceModel->getSearchableCategories($storeId, $categoryIds, $fromId, $limit);
} | php | private function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
{
return $this->resourceModel->getSearchableCategories($storeId, $categoryIds, $fromId, $limit);
} | [
"private",
"function",
"getSearchableCategories",
"(",
"$",
"storeId",
",",
"$",
"categoryIds",
"=",
"null",
",",
"$",
"fromId",
"=",
"0",
",",
"$",
"limit",
"=",
"100",
")",
"{",
"return",
"$",
"this",
"->",
"resourceModel",
"->",
"getSearchableCategories",... | Load a bulk of product data.
@param int $storeId Store id.
@param string $categoryIds Category ids filter.
@param integer $fromId Load product with id greater than.
@param integer $limit Number of product to get loaded.
@return array | [
"Load",
"a",
"bulk",
"of",
"product",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Action/Full.php#L75-L78 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/ProviderFactory.php | ProviderFactory.create | public function create($providerType, $providerParams = [])
{
if (!isset($this->factories[$providerType])) {
throw new \LogicException("No factory found for provider of type {$providerType}");
}
return $this->factories[$providerType]->create($providerParams);
} | php | public function create($providerType, $providerParams = [])
{
if (!isset($this->factories[$providerType])) {
throw new \LogicException("No factory found for provider of type {$providerType}");
}
return $this->factories[$providerType]->create($providerParams);
} | [
"public",
"function",
"create",
"(",
"$",
"providerType",
",",
"$",
"providerParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"providerType",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicExc... | Create an Optimizer Collection provider from it's type and params.
@param string $providerType Provider type (must be a valid query type defined into the factories array).
@param array $providerParams Provider constructor params.
@return ProviderInterface | [
"Create",
"an",
"Optimizer",
"Collection",
"provider",
"from",
"it",
"s",
"type",
"and",
"params",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Collection/ProviderFactory.php#L48-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Setup/InstallSchema.php | InstallSchema.install | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->optimizerSetup->createOptimizerTable($setup);
$this->optimizerSetup->createOptimizerSearchContainerTable($setup);
$setup->endSetup();
} | php | public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$this->optimizerSetup->createOptimizerTable($setup);
$this->optimizerSetup->createOptimizerSearchContainerTable($setup);
$setup->endSetup();
} | [
"public",
"function",
"install",
"(",
"SchemaSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"this",
"->",
"optimizerSetup",
"->",
"createOptimizerTable",
"(",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Setup/InstallSchema.php#L48-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php | Catalog.getVariables | public function getVariables()
{
$variables = array_merge(
$this->getCategoryVariables(),
$this->getProductVariables(),
$this->getProductListVariables(),
$this->getLayerVariables()
);
return $variables;
} | php | public function getVariables()
{
$variables = array_merge(
$this->getCategoryVariables(),
$this->getProductVariables(),
$this->getProductListVariables(),
$this->getLayerVariables()
);
return $variables;
} | [
"public",
"function",
"getVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getCategoryVariables",
"(",
")",
",",
"$",
"this",
"->",
"getProductVariables",
"(",
")",
",",
"$",
"this",
"->",
"getProductListVariables",
"... | Return the list of catalog related variables.
@return array | [
"Return",
"the",
"list",
"of",
"catalog",
"related",
"variables",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php#L62-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php | Catalog.getCategoryVariables | private function getCategoryVariables()
{
$variables = [];
if ($this->registry->registry('current_category')) {
$category = $this->registry->registry('current_category');
$variables['category.id'] = $category->getId();
$variables['category.label'] = $category-... | php | private function getCategoryVariables()
{
$variables = [];
if ($this->registry->registry('current_category')) {
$category = $this->registry->registry('current_category');
$variables['category.id'] = $category->getId();
$variables['category.label'] = $category-... | [
"private",
"function",
"getCategoryVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"registry",
"->",
"registry",
"(",
"'current_category'",
")",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"registry",... | Returns categories variables (id, name and path).
@return array | [
"Returns",
"categories",
"variables",
"(",
"id",
"name",
"and",
"path",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php#L79-L91 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php | Catalog.getProductVariables | private function getProductVariables()
{
$variables = [];
if ($this->registry->registry('current_product')) {
$product = $this->registry->registry('current_product');
$variables['product.id'] = $product->getId();
$variables['product.label'] = $product->getName();... | php | private function getProductVariables()
{
$variables = [];
if ($this->registry->registry('current_product')) {
$product = $this->registry->registry('current_product');
$variables['product.id'] = $product->getId();
$variables['product.label'] = $product->getName();... | [
"private",
"function",
"getProductVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"registry",
"->",
"registry",
"(",
"'current_product'",
")",
")",
"{",
"$",
"product",
"=",
"$",
"this",
"->",
"registry",
... | Return list of the product relatedd variables (id, label, sku)
@return array | [
"Return",
"list",
"of",
"the",
"product",
"relatedd",
"variables",
"(",
"id",
"label",
"sku",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php#L98-L110 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php | Catalog.getLayerVariables | private function getLayerVariables()
{
$variables = [];
$layer = $this->catalogLayer;
if ($layer) {
$layerState = $layer->getState();
foreach ($layerState->getFilters() as $currentFilter) {
$identifier = $currentFilter->getRequestVar();
... | php | private function getLayerVariables()
{
$variables = [];
$layer = $this->catalogLayer;
if ($layer) {
$layerState = $layer->getState();
foreach ($layerState->getFilters() as $currentFilter) {
$identifier = $currentFilter->getRequestVar();
... | [
"private",
"function",
"getLayerVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"$",
"layer",
"=",
"$",
"this",
"->",
"catalogLayer",
";",
"if",
"(",
"$",
"layer",
")",
"{",
"$",
"layerState",
"=",
"$",
"layer",
"->",
"getState",
"("... | Return list of product list variables (pages, sort, display mode, filters)
@return array | [
"Return",
"list",
"of",
"product",
"list",
"variables",
"(",
"pages",
"sort",
"display",
"mode",
"filters",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php#L117-L140 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php | Catalog.getProductListVariables | private function getProductListVariables()
{
$variables = [];
$productListBlock = $this->getProductListBlock();
if ($productListBlock !== null && $productListBlock->getCollection()) {
$variables['product_list.page_count'] = $productListBlock->getLastPageNum();
$vari... | php | private function getProductListVariables()
{
$variables = [];
$productListBlock = $this->getProductListBlock();
if ($productListBlock !== null && $productListBlock->getCollection()) {
$variables['product_list.page_count'] = $productListBlock->getLastPageNum();
$vari... | [
"private",
"function",
"getProductListVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"$",
"productListBlock",
"=",
"$",
"this",
"->",
"getProductListBlock",
"(",
")",
";",
"if",
"(",
"$",
"productListBlock",
"!==",
"null",
"&&",
"$",
"pro... | Return list of product list variables (pages, sort, display mode)
@return array
@throws \Magento\Framework\Exception\LocalizedException | [
"Return",
"list",
"of",
"product",
"list",
"variables",
"(",
"pages",
"sort",
"display",
"mode",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php#L148-L164 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Range.php | Range.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_RANGE) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$queryParams = $query->getBounds();
$queryParams['boost'] = $query... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_RANGE) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$queryParams = $query->getBounds();
$queryParams['boost'] = $query... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_RANGE",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query builde... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Range.php#L32-L48 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/RelevanceConfig/App/Config/ScopePool.php | ScopePool.getScope | public function getScope($scopeType, $scopeCode = null)
{
$scopeCode = $this->scopeCodeResolver->resolve($scopeType, $scopeCode);
$code = $scopeType . '|' . $scopeCode;
if (!isset($this->scopes[$code])) {
$cacheKey = $this->cacheId . '|' . $code;
$data = $this->... | php | public function getScope($scopeType, $scopeCode = null)
{
$scopeCode = $this->scopeCodeResolver->resolve($scopeType, $scopeCode);
$code = $scopeType . '|' . $scopeCode;
if (!isset($this->scopes[$code])) {
$cacheKey = $this->cacheId . '|' . $code;
$data = $this->... | [
"public",
"function",
"getScope",
"(",
"$",
"scopeType",
",",
"$",
"scopeCode",
"=",
"null",
")",
"{",
"$",
"scopeCode",
"=",
"$",
"this",
"->",
"scopeCodeResolver",
"->",
"resolve",
"(",
"$",
"scopeType",
",",
"$",
"scopeCode",
")",
";",
"$",
"code",
... | Retrieve config section
@SuppressWarnings(PHPMD.ElseExpression)
@param string $scopeType Scope Type
@param string|\Magento\Framework\DataObject|null $scopeCode Scope Code
@return \Magento\Framework\App\Config\DataInterface | [
"Retrieve",
"config",
"section"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/RelevanceConfig/App/Config/ScopePool.php#L90-L113 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php | ItemDataFactory.getData | public function getData(ProductInterface $product)
{
$productItemData = [
'id' => $product->getId(),
'sku' => $product->getSku(),
'name' => $product->getName(),
'price' => $this->getProductPrice($product),
'image' ... | php | public function getData(ProductInterface $product)
{
$productItemData = [
'id' => $product->getId(),
'sku' => $product->getSku(),
'name' => $product->getName(),
'price' => $this->getProductPrice($product),
'image' ... | [
"public",
"function",
"getData",
"(",
"ProductInterface",
"$",
"product",
")",
"{",
"$",
"productItemData",
"=",
"[",
"'id'",
"=>",
"$",
"product",
"->",
"getId",
"(",
")",
",",
"'sku'",
"=>",
"$",
"product",
"->",
"getSku",
"(",
")",
",",
"'name'",
"=... | Item data.
@param ProductInterface $product Product.
@return array | [
"Item",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php#L52-L65 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php | ItemDataFactory.getProductPrice | private function getProductPrice(ProductInterface $product)
{
$price = 0;
$document = $this->getDocumentSource($product);
if (isset($document['price'])) {
foreach ($document['price'] as $currentPrice) {
if ((int) $price['customer_group_id'] === GroupInterface:... | php | private function getProductPrice(ProductInterface $product)
{
$price = 0;
$document = $this->getDocumentSource($product);
if (isset($document['price'])) {
foreach ($document['price'] as $currentPrice) {
if ((int) $price['customer_group_id'] === GroupInterface:... | [
"private",
"function",
"getProductPrice",
"(",
"ProductInterface",
"$",
"product",
")",
"{",
"$",
"price",
"=",
"0",
";",
"$",
"document",
"=",
"$",
"this",
"->",
"getDocumentSource",
"(",
"$",
"product",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"document... | Returns current product sale price.
@param ProductInterface $product Product.
@return float | [
"Returns",
"current",
"product",
"sale",
"price",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php#L74-L88 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php | ItemDataFactory.isInStockProduct | private function isInStockProduct(ProductInterface $product)
{
$isInStock = false;
$document = $this->getDocumentSource($product);
if (isset($document['stock']['is_in_stock'])) {
$isInStock = (bool) $document['stock']['is_in_stock'];
}
return $isInStock;
} | php | private function isInStockProduct(ProductInterface $product)
{
$isInStock = false;
$document = $this->getDocumentSource($product);
if (isset($document['stock']['is_in_stock'])) {
$isInStock = (bool) $document['stock']['is_in_stock'];
}
return $isInStock;
} | [
"private",
"function",
"isInStockProduct",
"(",
"ProductInterface",
"$",
"product",
")",
"{",
"$",
"isInStock",
"=",
"false",
";",
"$",
"document",
"=",
"$",
"this",
"->",
"getDocumentSource",
"(",
"$",
"product",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | Returns current product stock status.
@param ProductInterface $product Product.
@return bool | [
"Returns",
"current",
"product",
"stock",
"status",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php#L97-L106 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php | ItemDataFactory.getImageUrl | private function getImageUrl(ProductInterface $product)
{
$this->imageHelper->init($product, 'smile_elasticsuite_product_sorter_image');
return $this->imageHelper->getUrl();
} | php | private function getImageUrl(ProductInterface $product)
{
$this->imageHelper->init($product, 'smile_elasticsuite_product_sorter_image');
return $this->imageHelper->getUrl();
} | [
"private",
"function",
"getImageUrl",
"(",
"ProductInterface",
"$",
"product",
")",
"{",
"$",
"this",
"->",
"imageHelper",
"->",
"init",
"(",
"$",
"product",
",",
"'smile_elasticsuite_product_sorter_image'",
")",
";",
"return",
"$",
"this",
"->",
"imageHelper",
... | Get resized image URL.
@param ProductInterface $product Product.
@return string | [
"Get",
"resized",
"image",
"URL",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ProductSorter/ItemDataFactory.php#L115-L120 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Rule/Condition/Combine.php | Combine.getSearchQuery | public function getSearchQuery($excludedCategories = [])
{
$queryParams = [];
$aggregator = $this->getAggregator();
$value = (bool) $this->getValue();
$queryClause = $aggregator === 'all' ? 'must' : 'should';
foreach ($this->getConditions() as $condition) {
... | php | public function getSearchQuery($excludedCategories = [])
{
$queryParams = [];
$aggregator = $this->getAggregator();
$value = (bool) $this->getValue();
$queryClause = $aggregator === 'all' ? 'must' : 'should';
foreach ($this->getConditions() as $condition) {
... | [
"public",
"function",
"getSearchQuery",
"(",
"$",
"excludedCategories",
"=",
"[",
"]",
")",
"{",
"$",
"queryParams",
"=",
"[",
"]",
";",
"$",
"aggregator",
"=",
"$",
"this",
"->",
"getAggregator",
"(",
")",
";",
"$",
"value",
"=",
"(",
"bool",
")",
"... | Build a search query for the current rule.
@param array $excludedCategories Categories excluded of query building (avoid infinite recursion).
@return QueryInterface | [
"Build",
"a",
"search",
"query",
"for",
"the",
"current",
"rule",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Rule/Condition/Combine.php#L39-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.getSpellingType | public function getSpellingType(RequestInterface $request)
{
$cacheKey = $this->getCacheKey($request);
$spellingType = $this->cacheHelper->loadCache($cacheKey);
if ($spellingType === false) {
$spellingType = $this->loadSpellingType($request);
$this->cacheHelper->sav... | php | public function getSpellingType(RequestInterface $request)
{
$cacheKey = $this->getCacheKey($request);
$spellingType = $this->cacheHelper->loadCache($cacheKey);
if ($spellingType === false) {
$spellingType = $this->loadSpellingType($request);
$this->cacheHelper->sav... | [
"public",
"function",
"getSpellingType",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"getCacheKey",
"(",
"$",
"request",
")",
";",
"$",
"spellingType",
"=",
"$",
"this",
"->",
"cacheHelper",
"->",
"loadCache",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L59-L71 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.loadSpellingType | private function loadSpellingType(RequestInterface $request)
{
$spellingType = self::SPELLING_TYPE_FUZZY;
try {
$cutoffFrequencyLimit = $this->getCutoffrequencyLimit($request);
$termVectors = $this->getTermVectors($request);
$queryTermStats = $this... | php | private function loadSpellingType(RequestInterface $request)
{
$spellingType = self::SPELLING_TYPE_FUZZY;
try {
$cutoffFrequencyLimit = $this->getCutoffrequencyLimit($request);
$termVectors = $this->getTermVectors($request);
$queryTermStats = $this... | [
"private",
"function",
"loadSpellingType",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"spellingType",
"=",
"self",
"::",
"SPELLING_TYPE_FUZZY",
";",
"try",
"{",
"$",
"cutoffFrequencyLimit",
"=",
"$",
"this",
"->",
"getCutoffrequencyLimit",
"(",
"$",
... | Compute the spelling time using the engine.
@param RequestInterface $request Spellchecking request.
@return integer | [
"Compute",
"the",
"spelling",
"time",
"using",
"the",
"engine",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L80-L103 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.getCacheKey | private function getCacheKey(RequestInterface $request)
{
return implode('|', [$request->getIndex(), $request->getType(), $request->getQueryText()]);
} | php | private function getCacheKey(RequestInterface $request)
{
return implode('|', [$request->getIndex(), $request->getType(), $request->getQueryText()]);
} | [
"private",
"function",
"getCacheKey",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"return",
"implode",
"(",
"'|'",
",",
"[",
"$",
"request",
"->",
"getIndex",
"(",
")",
",",
"$",
"request",
"->",
"getType",
"(",
")",
",",
"$",
"request",
"->",
"... | Compute an unique caching key for the spellcheck request.
@param RequestInterface $request Spellchecking request.
@return string | [
"Compute",
"an",
"unique",
"caching",
"key",
"for",
"the",
"spellcheck",
"request",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L112-L115 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.getCutoffrequencyLimit | private function getCutoffrequencyLimit(RequestInterface $request)
{
$indexStatsResponse = $this->client->indexStats($request->getIndex());
$indexStats = current($indexStatsResponse['indices']);
$totalIndexedDocs = $indexStats['total']['docs']['count'];
return $request->getC... | php | private function getCutoffrequencyLimit(RequestInterface $request)
{
$indexStatsResponse = $this->client->indexStats($request->getIndex());
$indexStats = current($indexStatsResponse['indices']);
$totalIndexedDocs = $indexStats['total']['docs']['count'];
return $request->getC... | [
"private",
"function",
"getCutoffrequencyLimit",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"indexStatsResponse",
"=",
"$",
"this",
"->",
"client",
"->",
"indexStats",
"(",
"$",
"request",
"->",
"getIndex",
"(",
")",
")",
";",
"$",
"indexStats",
... | Count document into the index and then multiply it by the request cutoff frequency
to compute an absolute cutoff frequency limit (max numbre of doc).
@param RequestInterface $request The spellcheck request.
@return int | [
"Count",
"document",
"into",
"the",
"index",
"and",
"then",
"multiply",
"it",
"by",
"the",
"request",
"cutoff",
"frequency",
"to",
"compute",
"an",
"absolute",
"cutoff",
"frequency",
"limit",
"(",
"max",
"numbre",
"of",
"doc",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L125-L132 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.getTermVectors | private function getTermVectors(RequestInterface $request)
{
$termVectorsQuery = [
'index' => $request->getIndex(),
'type' => $request->getType(),
'term_statistics' => true,
'fields' => [
MappingInterface::DEFAULT_... | php | private function getTermVectors(RequestInterface $request)
{
$termVectorsQuery = [
'index' => $request->getIndex(),
'type' => $request->getType(),
'term_statistics' => true,
'fields' => [
MappingInterface::DEFAULT_... | [
"private",
"function",
"getTermVectors",
"(",
"RequestInterface",
"$",
"request",
")",
"{",
"$",
"termVectorsQuery",
"=",
"[",
"'index'",
"=>",
"$",
"request",
"->",
"getIndex",
"(",
")",
",",
"'type'",
"=>",
"$",
"request",
"->",
"getType",
"(",
")",
",",... | Run a term vectors query against the index and return the result.
@param RequestInterface $request The spellcheck request.
@return array | [
"Run",
"a",
"term",
"vectors",
"query",
"against",
"the",
"index",
"and",
"return",
"the",
"result",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L141-L156 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.parseTermVectors | private function parseTermVectors($termVectors, $cutoffFrequencyLimit)
{
$queryTermStats = ['stop' => 0, 'exact' => 0, 'standard' => 0, 'missing' => 0];
$statByPosition = $this->extractTermStatsByPoisition($termVectors);
foreach ($statByPosition as $positionStat) {
$type = 'miss... | php | private function parseTermVectors($termVectors, $cutoffFrequencyLimit)
{
$queryTermStats = ['stop' => 0, 'exact' => 0, 'standard' => 0, 'missing' => 0];
$statByPosition = $this->extractTermStatsByPoisition($termVectors);
foreach ($statByPosition as $positionStat) {
$type = 'miss... | [
"private",
"function",
"parseTermVectors",
"(",
"$",
"termVectors",
",",
"$",
"cutoffFrequencyLimit",
")",
"{",
"$",
"queryTermStats",
"=",
"[",
"'stop'",
"=>",
"0",
",",
"'exact'",
"=>",
"0",
",",
"'standard'",
"=>",
"0",
",",
"'missing'",
"=>",
"0",
"]",... | Parse the terms vectors to extract stats on the query.
Result is an array containing :
- total : number of terms into the query
- stop : number of stopwords into the query
- exact : number of terms correctly spelled into the query
- missing : number of terms of the query not found into the index
- standard :... | [
"Parse",
"the",
"terms",
"vectors",
"to",
"extract",
"stats",
"on",
"the",
"query",
".",
"Result",
"is",
"an",
"array",
"containing",
":",
"-",
"total",
":",
"number",
"of",
"terms",
"into",
"the",
"query",
"-",
"stop",
":",
"number",
"of",
"stopwords",
... | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L172-L193 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.extractTermStatsByPoisition | private function extractTermStatsByPoisition($termVectors)
{
$statByPosition = [];
$analyzers = [FieldInterface::ANALYZER_STANDARD, FieldInterface::ANALYZER_WHITESPACE];
foreach ($termVectors['term_vectors'] as $propertyName => $fieldData) {
$analyzer = $this->getAnalyzer($... | php | private function extractTermStatsByPoisition($termVectors)
{
$statByPosition = [];
$analyzers = [FieldInterface::ANALYZER_STANDARD, FieldInterface::ANALYZER_WHITESPACE];
foreach ($termVectors['term_vectors'] as $propertyName => $fieldData) {
$analyzer = $this->getAnalyzer($... | [
"private",
"function",
"extractTermStatsByPoisition",
"(",
"$",
"termVectors",
")",
"{",
"$",
"statByPosition",
"=",
"[",
"]",
";",
"$",
"analyzers",
"=",
"[",
"FieldInterface",
"::",
"ANALYZER_STANDARD",
",",
"FieldInterface",
"::",
"ANALYZER_WHITESPACE",
"]",
";... | Extract term stats by position from a term vectors query response.
Wil return an array of doc_freq, analayzers and term by position.
@param array $termVectors The term vector query response.
@return array | [
"Extract",
"term",
"stats",
"by",
"position",
"from",
"a",
"term",
"vectors",
"query",
"response",
".",
"Wil",
"return",
"an",
"array",
"of",
"doc_freq",
"analayzers",
"and",
"term",
"by",
"position",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L203-L238 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php | Spellchecker.getAnalyzer | private function getAnalyzer($propertyName)
{
$analyzer = FieldInterface::ANALYZER_STANDARD;
if (strstr($propertyName, '.')) {
$propertyNameParts = explode('.', $propertyName);
$analyzer = end($propertyNameParts);
}
return $analyzer;
} | php | private function getAnalyzer($propertyName)
{
$analyzer = FieldInterface::ANALYZER_STANDARD;
if (strstr($propertyName, '.')) {
$propertyNameParts = explode('.', $propertyName);
$analyzer = end($propertyNameParts);
}
return $analyzer;
} | [
"private",
"function",
"getAnalyzer",
"(",
"$",
"propertyName",
")",
"{",
"$",
"analyzer",
"=",
"FieldInterface",
"::",
"ANALYZER_STANDARD",
";",
"if",
"(",
"strstr",
"(",
"$",
"propertyName",
",",
"'.'",
")",
")",
"{",
"$",
"propertyNameParts",
"=",
"explod... | Extract analayser from a mapping property name.
@param string $propertyName Property name (eg. : search.whitespace)
@return string | [
"Extract",
"analayser",
"from",
"a",
"mapping",
"property",
"name",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Spellchecker.php#L247-L257 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php | ReadHandler.execute | public function execute($entity, $arguments = [])
{
if ($entity->getId()) {
$searchContainers = $entity->getResource()->getSearchContainersFromOptimizerId($entity->getId());
$this->getCategoryLimitation($entity, $searchContainers);
$this->getSearchQueryLimitation($entity,... | php | public function execute($entity, $arguments = [])
{
if ($entity->getId()) {
$searchContainers = $entity->getResource()->getSearchContainersFromOptimizerId($entity->getId());
$this->getCategoryLimitation($entity, $searchContainers);
$this->getSearchQueryLimitation($entity,... | [
"public",
"function",
"execute",
"(",
"$",
"entity",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"entity",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"searchContainers",
"=",
"$",
"entity",
"->",
"getResource",
"(",
")",
"->",
"get... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php#L46-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php | ReadHandler.getCategoryLimitation | private function getCategoryLimitation($entity, $searchContainers)
{
$applyTo = (bool) ($searchContainers['catalog_view_container'] ?? false);
if ($applyTo) {
$containerData = ['apply_to' => (int) true];
$categoryIds = $this->resource->getCategoryIdsByOptimizer($entity);
... | php | private function getCategoryLimitation($entity, $searchContainers)
{
$applyTo = (bool) ($searchContainers['catalog_view_container'] ?? false);
if ($applyTo) {
$containerData = ['apply_to' => (int) true];
$categoryIds = $this->resource->getCategoryIdsByOptimizer($entity);
... | [
"private",
"function",
"getCategoryLimitation",
"(",
"$",
"entity",
",",
"$",
"searchContainers",
")",
"{",
"$",
"applyTo",
"=",
"(",
"bool",
")",
"(",
"$",
"searchContainers",
"[",
"'catalog_view_container'",
"]",
"??",
"false",
")",
";",
"if",
"(",
"$",
... | Retrieve category ids limitation for the current optimizer, if any.
@param OptimizerInterface $entity The optimizer being saved
@param array $searchContainers Search Containers data for the current optimizer.
@return array | [
"Retrieve",
"category",
"ids",
"limitation",
"for",
"the",
"current",
"optimizer",
"if",
"any",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php#L65-L77 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php | ReadHandler.getSearchQueryLimitation | private function getSearchQueryLimitation($entity, $searchContainers)
{
$applyTo = (bool) ($searchContainers['quick_search_container'] ?? ($searchContainers['catalog_product_autocomplete'] ?? false));
if ($applyTo) {
$containerData = ['apply_to' => (int) true];
$queryIds ... | php | private function getSearchQueryLimitation($entity, $searchContainers)
{
$applyTo = (bool) ($searchContainers['quick_search_container'] ?? ($searchContainers['catalog_product_autocomplete'] ?? false));
if ($applyTo) {
$containerData = ['apply_to' => (int) true];
$queryIds ... | [
"private",
"function",
"getSearchQueryLimitation",
"(",
"$",
"entity",
",",
"$",
"searchContainers",
")",
"{",
"$",
"applyTo",
"=",
"(",
"bool",
")",
"(",
"$",
"searchContainers",
"[",
"'quick_search_container'",
"]",
"??",
"(",
"$",
"searchContainers",
"[",
"... | Retrieve query ids limitation for the current optimizer, if any.
@param OptimizerInterface $entity The optimizer being saved
@param array $searchContainers Search Containers data for the current optimizer.
@return array | [
"Retrieve",
"query",
"ids",
"limitation",
"for",
"the",
"current",
"optimizer",
"if",
"any",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/ReadHandler.php#L87-L102 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Category/Indexer/Fulltext/Action/Full.php | Full.getSearchableCategories | public function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
{
/**
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
*/
$categoryCollection = $this->categoryCollectionFactory->create();
$categoryCollecti... | php | public function getSearchableCategories($storeId, $categoryIds = null, $fromId = 0, $limit = 100)
{
/**
* @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection
*/
$categoryCollection = $this->categoryCollectionFactory->create();
$categoryCollecti... | [
"public",
"function",
"getSearchableCategories",
"(",
"$",
"storeId",
",",
"$",
"categoryIds",
"=",
"null",
",",
"$",
"fromId",
"=",
"0",
",",
"$",
"limit",
"=",
"100",
")",
"{",
"/**\n * @var \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Collection $categ... | Load a bulk of category data.
@param int $storeId Store id.
@param string $categoryIds Product ids filter.
@param integer $fromId Load product with id greater than.
@param integer $limit Number of product to get loaded.
@return array | [
"Load",
"a",
"bulk",
"of",
"category",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/Indexer/Fulltext/Action/Full.php#L65-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Category/Indexer/Fulltext/Action/Full.php | Full.addIsVisibleInStoreFilter | private function addIsVisibleInStoreFilter($select, $storeId)
{
$rootCategoryId = $this->getRootCategoryId($storeId);
$select->where('e.path LIKE ?', "1/{$rootCategoryId}%");
return $this;
} | php | private function addIsVisibleInStoreFilter($select, $storeId)
{
$rootCategoryId = $this->getRootCategoryId($storeId);
$select->where('e.path LIKE ?', "1/{$rootCategoryId}%");
return $this;
} | [
"private",
"function",
"addIsVisibleInStoreFilter",
"(",
"$",
"select",
",",
"$",
"storeId",
")",
"{",
"$",
"rootCategoryId",
"=",
"$",
"this",
"->",
"getRootCategoryId",
"(",
"$",
"storeId",
")",
";",
"$",
"select",
"->",
"where",
"(",
"'e.path LIKE ?'",
",... | Filter the select to append only categories that are childrens of the root category of current store.
@param \Zend_Db_Select $select Product select to be filtered.
@param integer $storeId Store Id
@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Action\Full Self Reference | [
"Filter",
"the",
"select",
"to",
"append",
"only",
"categories",
"that",
"are",
"childrens",
"of",
"the",
"root",
"category",
"of",
"current",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Category/Indexer/Fulltext/Action/Full.php#L95-L102 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Block/Variables/Page/Cms.php | Cms.getVariables | public function getVariables()
{
$variables = [];
if ($this->page->getId()) {
$variables['cms.identifier'] = $this->page->getIdentifier();
$variables['cms.title'] = $this->page->getTitle();
}
return $variables;
} | php | public function getVariables()
{
$variables = [];
if ($this->page->getId()) {
$variables['cms.identifier'] = $this->page->getIdentifier();
$variables['cms.title'] = $this->page->getTitle();
}
return $variables;
} | [
"public",
"function",
"getVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"page",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"variables",
"[",
"'cms.identifier'",
"]",
"=",
"$",
"this",
"->",
"page",
"->"... | Append the CMS page viewed identifier and title to the list of tracked variables
@return array | [
"Append",
"the",
"CMS",
"page",
"viewed",
"identifier",
"and",
"title",
"to",
"the",
"list",
"of",
"tracked",
"variables"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Block/Variables/Page/Cms.php#L62-L72 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Datasource/AttributeData.php | AttributeData.addData | public function addData($storeId, array $indexData)
{
$categoryIds = array_keys($indexData);
foreach ($this->attributeIdsByTable as $backendTable => $attributeIds) {
$attributesData = $this->loadAttributesRawData($storeId, $categoryIds, $backendTable, $attributeIds);
forea... | php | public function addData($storeId, array $indexData)
{
$categoryIds = array_keys($indexData);
foreach ($this->attributeIdsByTable as $backendTable => $attributeIds) {
$attributesData = $this->loadAttributesRawData($storeId, $categoryIds, $backendTable, $attributeIds);
forea... | [
"public",
"function",
"addData",
"(",
"$",
"storeId",
",",
"array",
"$",
"indexData",
")",
"{",
"$",
"categoryIds",
"=",
"array_keys",
"(",
"$",
"indexData",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"attributeIdsByTable",
"as",
"$",
"backendTable",
"=>... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Category/Indexer/Fulltext/Datasource/AttributeData.php#L34-L55 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Observer/CleanCookiesOnLogout.php | CleanCookiesOnLogout.execute | public function execute(\Magento\Framework\Event\Observer $observer)
{
$cookieNames = $this->getCookies();
$metadata = $this->cookieMetadataFactory->createPublicCookieMetadata();
$metadata->setPath($this->getCookieConfiguration()['path'] ?? '/');
foreach ($cookieNames as $cookieNam... | php | public function execute(\Magento\Framework\Event\Observer $observer)
{
$cookieNames = $this->getCookies();
$metadata = $this->cookieMetadataFactory->createPublicCookieMetadata();
$metadata->setPath($this->getCookieConfiguration()['path'] ?? '/');
foreach ($cookieNames as $cookieNam... | [
"public",
"function",
"execute",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Event",
"\\",
"Observer",
"$",
"observer",
")",
"{",
"$",
"cookieNames",
"=",
"$",
"this",
"->",
"getCookies",
"(",
")",
";",
"$",
"metadata",
"=",
"$",
"this",
"->",
"coo... | Clean customer tracking cookies when logging out.
@SuppressWarnings(PHPMD.UnusedFormalParameter)
@event customer_logout
@param \Magento\Framework\Event\Observer $observer The observer
@return void | [
"Clean",
"customer",
"tracking",
"cookies",
"when",
"logging",
"out",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Observer/CleanCookiesOnLogout.php#L68-L78 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Observer/CleanCookiesOnLogout.php | CleanCookiesOnLogout.getCookies | private function getCookies()
{
$cookieConfiguration = $this->getCookieConfiguration();
$cookies = [
$cookieConfiguration['visit_cookie_name'] ?? null,
$cookieConfiguration['visitor_cookie_name'] ?? null,
];
return array_filter($cookies);
} | php | private function getCookies()
{
$cookieConfiguration = $this->getCookieConfiguration();
$cookies = [
$cookieConfiguration['visit_cookie_name'] ?? null,
$cookieConfiguration['visitor_cookie_name'] ?? null,
];
return array_filter($cookies);
} | [
"private",
"function",
"getCookies",
"(",
")",
"{",
"$",
"cookieConfiguration",
"=",
"$",
"this",
"->",
"getCookieConfiguration",
"(",
")",
";",
"$",
"cookies",
"=",
"[",
"$",
"cookieConfiguration",
"[",
"'visit_cookie_name'",
"]",
"??",
"null",
",",
"$",
"c... | Retrieve cookies names from configuration.
@return array | [
"Retrieve",
"cookies",
"names",
"from",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Observer/CleanCookiesOnLogout.php#L85-L95 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Observer/ConvertVirtualRuleOnSave.php | ConvertVirtualRuleOnSave.execute | public function execute(\Magento\Framework\Event\Observer $observer)
{
$entity = $observer->getEntity();
if ($entity->getVirtualRule() !== null) {
$this->saveHandler->execute($entity);
}
} | php | public function execute(\Magento\Framework\Event\Observer $observer)
{
$entity = $observer->getEntity();
if ($entity->getVirtualRule() !== null) {
$this->saveHandler->execute($entity);
}
} | [
"public",
"function",
"execute",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Event",
"\\",
"Observer",
"$",
"observer",
")",
"{",
"$",
"entity",
"=",
"$",
"observer",
"->",
"getEntity",
"(",
")",
";",
"if",
"(",
"$",
"entity",
"->",
"getVirtualRule",... | Observer listening to magento_catalog_api_data_categoryinterface_save_before
@param \Magento\Framework\Event\Observer $observer The Observer
@return void | [
"Observer",
"listening",
"to",
"magento_catalog_api_data_categoryinterface_save_before"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Observer/ConvertVirtualRuleOnSave.php#L49-L56 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php | PriceSlider.getConfig | protected function getConfig()
{
$config = parent::getConfig();
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$config['step'] = $this->getStepValue();
}
if ($this->getFilter()->getCurrencyRate()) {
$config['rate'] = $this->getFilter()->g... | php | protected function getConfig()
{
$config = parent::getConfig();
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$config['step'] = $this->getStepValue();
}
if ($this->getFilter()->getCurrencyRate()) {
$config['rate'] = $this->getFilter()->g... | [
"protected",
"function",
"getConfig",
"(",
")",
"{",
"$",
"config",
"=",
"parent",
"::",
"getConfig",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isManualCalculation",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"getStepValue",
"(",
")",
">",
"0",
")",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php#L55-L68 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php | PriceSlider.getMinValue | protected function getMinValue()
{
$minValue = $this->getFilter()->getMinValue();
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$stepValue = $this->getStepValue();
$minValue = floor($minValue / $stepValue) * $stepValue;
}
return $minVal... | php | protected function getMinValue()
{
$minValue = $this->getFilter()->getMinValue();
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$stepValue = $this->getStepValue();
$minValue = floor($minValue / $stepValue) * $stepValue;
}
return $minVal... | [
"protected",
"function",
"getMinValue",
"(",
")",
"{",
"$",
"minValue",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getMinValue",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isManualCalculation",
"(",
")",
"&&",
"(",
"$",
"this",
"->",
"g... | Returns min value of the slider.
@return int | [
"Returns",
"min",
"value",
"of",
"the",
"slider",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php#L75-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php | PriceSlider.getMaxValue | protected function getMaxValue()
{
$maxValue = $this->getFilter()->getMaxValue() + 1;
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$stepValue = $this->getStepValue();
$maxValue = ceil($maxValue / $stepValue) * $stepValue;
}
return $max... | php | protected function getMaxValue()
{
$maxValue = $this->getFilter()->getMaxValue() + 1;
if ($this->isManualCalculation() && ($this->getStepValue() > 0)) {
$stepValue = $this->getStepValue();
$maxValue = ceil($maxValue / $stepValue) * $stepValue;
}
return $max... | [
"protected",
"function",
"getMaxValue",
"(",
")",
"{",
"$",
"maxValue",
"=",
"$",
"this",
"->",
"getFilter",
"(",
")",
"->",
"getMaxValue",
"(",
")",
"+",
"1",
";",
"if",
"(",
"$",
"this",
"->",
"isManualCalculation",
"(",
")",
"&&",
"(",
"$",
"this"... | Returns max value of the slider.
@return int | [
"Returns",
"max",
"value",
"of",
"the",
"slider",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php#L92-L102 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php | PriceSlider.isManualCalculation | private function isManualCalculation()
{
$result = false;
$calculation = $this->_scopeConfig->getValue(PriceDataProvider::XML_PATH_RANGE_CALCULATION, ScopeInterface::SCOPE_STORE);
if ($calculation === PriceDataProvider::RANGE_CALCULATION_MANUAL) {
$result = true;
}
... | php | private function isManualCalculation()
{
$result = false;
$calculation = $this->_scopeConfig->getValue(PriceDataProvider::XML_PATH_RANGE_CALCULATION, ScopeInterface::SCOPE_STORE);
if ($calculation === PriceDataProvider::RANGE_CALCULATION_MANUAL) {
$result = true;
}
... | [
"private",
"function",
"isManualCalculation",
"(",
")",
"{",
"$",
"result",
"=",
"false",
";",
"$",
"calculation",
"=",
"$",
"this",
"->",
"_scopeConfig",
"->",
"getValue",
"(",
"PriceDataProvider",
"::",
"XML_PATH_RANGE_CALCULATION",
",",
"ScopeInterface",
"::",
... | Check if price interval is manually set in the configuration
@return bool | [
"Check",
"if",
"price",
"interval",
"is",
"manually",
"set",
"in",
"the",
"configuration"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php#L109-L119 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php | PriceSlider.getStepValue | private function getStepValue()
{
$value = $this->_scopeConfig->getValue(PriceDataProvider::XML_PATH_RANGE_STEP, ScopeInterface::SCOPE_STORE);
return (int) $value;
} | php | private function getStepValue()
{
$value = $this->_scopeConfig->getValue(PriceDataProvider::XML_PATH_RANGE_STEP, ScopeInterface::SCOPE_STORE);
return (int) $value;
} | [
"private",
"function",
"getStepValue",
"(",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"_scopeConfig",
"->",
"getValue",
"(",
"PriceDataProvider",
"::",
"XML_PATH_RANGE_STEP",
",",
"ScopeInterface",
"::",
"SCOPE_STORE",
")",
";",
"return",
"(",
"int",
")"... | Retrieve the value for "Default Price Navigation Step".
@return int | [
"Retrieve",
"the",
"value",
"for",
"Default",
"Price",
"Navigation",
"Step",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/PriceSlider.php#L126-L131 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Client/Client.php | Client.putMapping | public function putMapping($indexName, $type, $mapping)
{
$this->esClient->indices()->putMapping(['index' => $indexName, 'type' => $type, 'body' => [$type => $mapping]]);
} | php | public function putMapping($indexName, $type, $mapping)
{
$this->esClient->indices()->putMapping(['index' => $indexName, 'type' => $type, 'body' => [$type => $mapping]]);
} | [
"public",
"function",
"putMapping",
"(",
"$",
"indexName",
",",
"$",
"type",
",",
"$",
"mapping",
")",
"{",
"$",
"this",
"->",
"esClient",
"->",
"indices",
"(",
")",
"->",
"putMapping",
"(",
"[",
"'index'",
"=>",
"$",
"indexName",
",",
"'type'",
"=>",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/Client.php#L98-L101 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Client/Client.php | Client.getIndicesNameByAlias | public function getIndicesNameByAlias($indexAlias)
{
$indices = [];
try {
$indices = $this->esClient->indices()->getMapping(['index' => $indexAlias]);
} catch (\Elasticsearch\Common\Exceptions\Missing404Exception $e) {
;
}
return array_keys($indices);... | php | public function getIndicesNameByAlias($indexAlias)
{
$indices = [];
try {
$indices = $this->esClient->indices()->getMapping(['index' => $indexAlias]);
} catch (\Elasticsearch\Common\Exceptions\Missing404Exception $e) {
;
}
return array_keys($indices);... | [
"public",
"function",
"getIndicesNameByAlias",
"(",
"$",
"indexAlias",
")",
"{",
"$",
"indices",
"=",
"[",
"]",
";",
"try",
"{",
"$",
"indices",
"=",
"$",
"this",
"->",
"esClient",
"->",
"indices",
"(",
")",
"->",
"getMapping",
"(",
"[",
"'index'",
"=>... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Client/Client.php#L122-L132 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Product/Search/Position.php | Position.saveProductPositions | public function saveProductPositions($queryId, $newProductPositions, $blacklistedProducts = [])
{
$this->resourceModel->saveProductPositions($queryId, $newProductPositions, $blacklistedProducts);
foreach ($this->storeManager->getStores() as $store) {
if ($this->isPopularQuery($queryId, ... | php | public function saveProductPositions($queryId, $newProductPositions, $blacklistedProducts = [])
{
$this->resourceModel->saveProductPositions($queryId, $newProductPositions, $blacklistedProducts);
foreach ($this->storeManager->getStores() as $store) {
if ($this->isPopularQuery($queryId, ... | [
"public",
"function",
"saveProductPositions",
"(",
"$",
"queryId",
",",
"$",
"newProductPositions",
",",
"$",
"blacklistedProducts",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"resourceModel",
"->",
"saveProductPositions",
"(",
"$",
"queryId",
",",
"$",
"newP... | Save the product positions.
@param int $queryId Query id.
@param array $newProductPositions Product positions.
@param array $blacklistedProducts Blacklisted product ids.
@return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Search\Position | [
"Save",
"the",
"product",
"positions",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Position.php#L84-L93 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Product/Search/Position.php | Position.isPopularQuery | private function isPopularQuery($queryId, $storeId)
{
$popularQueryIds = $this->queryCollection
->setPopularQueryFilter($storeId)
->setPageSize($this->getMaxCountCacheableSearchTerms($storeId))
->load()
->getColumnValues('query_id');
return count(arra... | php | private function isPopularQuery($queryId, $storeId)
{
$popularQueryIds = $this->queryCollection
->setPopularQueryFilter($storeId)
->setPageSize($this->getMaxCountCacheableSearchTerms($storeId))
->load()
->getColumnValues('query_id');
return count(arra... | [
"private",
"function",
"isPopularQuery",
"(",
"$",
"queryId",
",",
"$",
"storeId",
")",
"{",
"$",
"popularQueryIds",
"=",
"$",
"this",
"->",
"queryCollection",
"->",
"setPopularQueryFilter",
"(",
"$",
"storeId",
")",
"->",
"setPageSize",
"(",
"$",
"this",
"-... | Check if a query Id is among the popular query list for a given store.
@param int $queryId The Query Id
@param int $storeId The Store Id
@return bool | [
"Check",
"if",
"a",
"query",
"Id",
"is",
"among",
"the",
"popular",
"query",
"list",
"for",
"a",
"given",
"store",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Position.php#L103-L112 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Product/Search/Position.php | Position.cleanPopularSearchCache | private function cleanPopularSearchCache()
{
try {
$this->frontendCachePool->get(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER)->clean(
\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG,
[\Smile\ElasticsuiteCatalog\Block\CatalogSearch\Result\Cache::POPULAR_SEARCH... | php | private function cleanPopularSearchCache()
{
try {
$this->frontendCachePool->get(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER)->clean(
\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG,
[\Smile\ElasticsuiteCatalog\Block\CatalogSearch\Result\Cache::POPULAR_SEARCH... | [
"private",
"function",
"cleanPopularSearchCache",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"frontendCachePool",
"->",
"get",
"(",
"\\",
"Magento",
"\\",
"PageCache",
"\\",
"Model",
"\\",
"Cache",
"\\",
"Type",
"::",
"TYPE_IDENTIFIER",
")",
"->",
"clean"... | Cleanup popular searches cache tag. | [
"Cleanup",
"popular",
"searches",
"cache",
"tag",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Search/Position.php#L117-L127 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Load.php | Load.execute | public function execute()
{
$queryId = $this->getRequest()->getParam('query_id', 0);
$pageSize = $this->getRequest()->getParam('page_size');
$query = $this->queryFactory->create()->load($queryId);
$responseData = ['products' => [], 'size' => 0];
if ($query->getId()) {
... | php | public function execute()
{
$queryId = $this->getRequest()->getParam('query_id', 0);
$pageSize = $this->getRequest()->getParam('page_size');
$query = $this->queryFactory->create()->load($queryId);
$responseData = ['products' => [], 'size' => 0];
if ($query->getId()) {
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"queryId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'query_id'",
",",
"0",
")",
";",
"$",
"pageSize",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam"... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Controller/Adminhtml/Term/Merchandiser/Load.php#L63-L81 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php | AggregationBuilder.buildAggregations | public function buildAggregations(ContainerConfigurationInterface $containerConfig, array $aggregations, array $filters)
{
$buckets = [];
foreach ($aggregations as $aggParams) {
$buckets[] = is_object($aggParams) ? $aggParams : $this->buildAggregation($containerConfig, $filters, $aggPar... | php | public function buildAggregations(ContainerConfigurationInterface $containerConfig, array $aggregations, array $filters)
{
$buckets = [];
foreach ($aggregations as $aggParams) {
$buckets[] = is_object($aggParams) ? $aggParams : $this->buildAggregation($containerConfig, $filters, $aggPar... | [
"public",
"function",
"buildAggregations",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"array",
"$",
"aggregations",
",",
"array",
"$",
"filters",
")",
"{",
"$",
"buckets",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aggregations",
"as",
... | Build the list of buckets from the mapping.
@param ContainerConfigurationInterface $containerConfig Search request configuration
@param array $aggregations Facet definitions.
@param array $filters Facet filters to be added to buckets.
@return BucketInterf... | [
"Build",
"the",
"list",
"of",
"buckets",
"from",
"the",
"mapping",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php#L81-L90 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php | AggregationBuilder.buildAggregation | private function buildAggregation(ContainerConfigurationInterface $containerConfig, $filters, $bucketParams)
{
$bucketType = $bucketParams['type'];
$fieldName = $bucketParams['field'] ?? $bucketParams['name'];
try {
$field = $containerConfig->getMapping()->getField($fieldName);... | php | private function buildAggregation(ContainerConfigurationInterface $containerConfig, $filters, $bucketParams)
{
$bucketType = $bucketParams['type'];
$fieldName = $bucketParams['field'] ?? $bucketParams['name'];
try {
$field = $containerConfig->getMapping()->getField($fieldName);... | [
"private",
"function",
"buildAggregation",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"filters",
",",
"$",
"bucketParams",
")",
"{",
"$",
"bucketType",
"=",
"$",
"bucketParams",
"[",
"'type'",
"]",
";",
"$",
"fieldName",
"=",
"$",
... | Build a single aggregation.
@param ContainerConfigurationInterface $containerConfig Search request configuration
@param array $filters Facet filters to be added to buckets.
@param array $bucketParams Current bucket params.
@return \Smile\ElasticsuiteCore\... | [
"Build",
"a",
"single",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php#L101-L144 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php | AggregationBuilder.createFilter | private function createFilter(ContainerConfigurationInterface $containerConfig, array $filters, $currentPath = null)
{
return $this->queryBuilder->create($containerConfig, $filters, $currentPath);
} | php | private function createFilter(ContainerConfigurationInterface $containerConfig, array $filters, $currentPath = null)
{
return $this->queryBuilder->create($containerConfig, $filters, $currentPath);
} | [
"private",
"function",
"createFilter",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"array",
"$",
"filters",
",",
"$",
"currentPath",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"queryBuilder",
"->",
"create",
"(",
"$",
"container... | Create a QueryInterface for a filter using the query builder.
@param ContainerConfigurationInterface $containerConfig Search container configuration
@param array $filters Filters definition.
@param string|null $currentPath Current nested path or null.
@return ... | [
"Create",
"a",
"QueryInterface",
"for",
"a",
"filter",
"using",
"the",
"query",
"builder",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php#L155-L158 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php | AggregationBuilder.createPipelines | private function createPipelines($bucketParams)
{
if (isset($bucketParams['pipelines'])) {
foreach ($bucketParams['pipelines'] as &$pipelineParams) {
$pipelineType = $pipelineParams['type'];
$pipelineParams = $this->pipelineFactory->create($pipelineType, $pipeline... | php | private function createPipelines($bucketParams)
{
if (isset($bucketParams['pipelines'])) {
foreach ($bucketParams['pipelines'] as &$pipelineParams) {
$pipelineType = $pipelineParams['type'];
$pipelineParams = $this->pipelineFactory->create($pipelineType, $pipeline... | [
"private",
"function",
"createPipelines",
"(",
"$",
"bucketParams",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"bucketParams",
"[",
"'pipelines'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"bucketParams",
"[",
"'pipelines'",
"]",
"as",
"&",
"$",
"pipelineParam... | Parse bucket params and create PipelineInterface instances
@param array $bucketParams Bucket params.
@return array | [
"Parse",
"bucket",
"params",
"and",
"create",
"PipelineInterface",
"instances"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Aggregation/AggregationBuilder.php#L167-L177 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.