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/Plugin/Indexer/Category/Save/ReindexProductsAfterSave.php | ReindexProductsAfterSave.aroundReindex | public function aroundReindex(
\Magento\Catalog\Model\Category $subject,
callable $proceed
) {
$proceed();
if (!empty($subject->getAffectedProductIds())) {
$this->processFullTextIndex($subject->getAffectedProductIds());
}
return;
} | php | public function aroundReindex(
\Magento\Catalog\Model\Category $subject,
callable $proceed
) {
$proceed();
if (!empty($subject->getAffectedProductIds())) {
$this->processFullTextIndex($subject->getAffectedProductIds());
}
return;
} | [
"public",
"function",
"aroundReindex",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"$",
"subject",
",",
"callable",
"$",
"proceed",
")",
"{",
"$",
"proceed",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"subject",
"->",... | Reindex category's products after reindexing the category
@param \Magento\Catalog\Model\Category $subject The cateogry being reindexed
@param callable $proceed The parent function we are plugged on
: Magento\Catalog\Model\Category::reindex()
@return \Magento\Catalog\Model\Category | [
"Reindex",
"category",
"s",
"products",
"after",
"reindexing",
"the",
"category"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/Indexer/Category/Save/ReindexProductsAfterSave.php#L37-L48 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/AbstractReport.php | AbstractReport.getData | public function getData()
{
if ($this->data === null) {
$searchRequest = $this->searchRequestBuilder->getRequest();
$searchResponse = $this->searchEngine->search($searchRequest);
$this->data = $this->processResponse($searchResponse);
}
return $this->dat... | php | public function getData()
{
if ($this->data === null) {
$searchRequest = $this->searchRequestBuilder->getRequest();
$searchResponse = $this->searchEngine->search($searchRequest);
$this->data = $this->processResponse($searchResponse);
}
return $this->dat... | [
"public",
"function",
"getData",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"data",
"===",
"null",
")",
"{",
"$",
"searchRequest",
"=",
"$",
"this",
"->",
"searchRequestBuilder",
"->",
"getRequest",
"(",
")",
";",
"$",
"searchResponse",
"=",
"$",
"th... | Get report data.
@return array | [
"Get",
"report",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/AbstractReport.php#L59-L69 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/MoreLikeThis.php | MoreLikeThis.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MORELIKETHIS) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'fields' => $query... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MORELIKETHIS) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'fields' => $query... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_MORELIKETHIS",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/MoreLikeThis.php#L32-L56 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.create | public function create(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost = 1)
{
$query = null;
$fuzzySpellingTypes = [SpellcheckerInterface::SPELLING_TYPE_FUZZY, SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY];
if (is_array($queryText)) {
$que... | php | public function create(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost = 1)
{
$query = null;
$fuzzySpellingTypes = [SpellcheckerInterface::SPELLING_TYPE_FUZZY, SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY];
if (is_array($queryText)) {
$que... | [
"public",
"function",
"create",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
",",
"$",
"spellingType",
",",
"$",
"boost",
"=",
"1",
")",
"{",
"$",
"query",
"=",
"null",
";",
"$",
"fuzzySpellingTypes",
"=",
"[",
"Spel... | Create the fulltext search query.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@param string $spellingType The type of spellchecked applied.
@param float ... | [
"Create",
"the",
"fulltext",
"search",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L67-L95 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getCutoffFrequencyQuery | private function getCutoffFrequencyQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$queryParams = [
'fields' => array_fill_keys([MappingInterface::DEFAULT_SEARCH_FIELD, 'sku'], 1),
'... | php | private function getCutoffFrequencyQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$queryParams = [
'fields' => array_fill_keys([MappingInterface::DEFAULT_SEARCH_FIELD, 'sku'], 1),
'... | [
"private",
"function",
"getCutoffFrequencyQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
")",
"{",
"$",
"relevanceConfig",
"=",
"$",
"containerConfig",
"->",
"getRelevanceConfig",
"(",
")",
";",
"$",
"queryParams",
"=",
... | Provides a common search query for the searched text.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@return QueryInterface | [
"Provides",
"a",
"common",
"search",
"query",
"for",
"the",
"searched",
"text",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L105-L117 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getWeightedSearchQuery | private function getWeightedSearchQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$phraseMatchBoost = $relevanceConfig->getPhraseMatchBoost();
$defaultSearchField = MappingInterface::DEFAULT_SEARCH... | php | private function getWeightedSearchQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$phraseMatchBoost = $relevanceConfig->getPhraseMatchBoost();
$defaultSearchField = MappingInterface::DEFAULT_SEARCH... | [
"private",
"function",
"getWeightedSearchQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
")",
"{",
"$",
"relevanceConfig",
"=",
"$",
"containerConfig",
"->",
"getRelevanceConfig",
"(",
")",
";",
"$",
"phraseMatchBoost",
"... | Provides a weighted search query (multi match) using mapping field configuration.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@return QueryInterface | [
"Provides",
"a",
"weighted",
"search",
"query",
"(",
"multi",
"match",
")",
"using",
"mapping",
"field",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L127-L155 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getPureStopwordsQuery | private function getPureStopwordsQuery(ContainerConfigurationInterface $containerConfig, $queryText, $boost)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$analyzer = FieldInterface::ANALYZER_WHITESPACE;
if (is_string($queryText) && str_word_count($queryText) > 1) {
... | php | private function getPureStopwordsQuery(ContainerConfigurationInterface $containerConfig, $queryText, $boost)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$analyzer = FieldInterface::ANALYZER_WHITESPACE;
if (is_string($queryText) && str_word_count($queryText) > 1) {
... | [
"private",
"function",
"getPureStopwordsQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
",",
"$",
"boost",
")",
"{",
"$",
"relevanceConfig",
"=",
"$",
"containerConfig",
"->",
"getRelevanceConfig",
"(",
")",
";",
"$",
... | Build a query when the fulltext search query contains only stopwords.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@param float $boost Boost of the created quer... | [
"Build",
"a",
"query",
"when",
"the",
"fulltext",
"search",
"query",
"contains",
"only",
"stopwords",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L166-L189 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getSpellcheckedQuery | private function getSpellcheckedQuery(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost)
{
$query = null;
$relevanceConfig = $containerConfig->getRelevanceConfig();
$queryClauses = [];
if ($relevanceConfig->isFuzzinessEnabled()) {
$quer... | php | private function getSpellcheckedQuery(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost)
{
$query = null;
$relevanceConfig = $containerConfig->getRelevanceConfig();
$queryClauses = [];
if ($relevanceConfig->isFuzzinessEnabled()) {
$quer... | [
"private",
"function",
"getSpellcheckedQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
",",
"$",
"spellingType",
",",
"$",
"boost",
")",
"{",
"$",
"query",
"=",
"null",
";",
"$",
"relevanceConfig",
"=",
"$",
"contai... | Spellcheked query building.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@param string $spellingType The type of spellchecked applied.
@param float ... | [
"Spellcheked",
"query",
"building",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L201-L227 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getFuzzyQuery | private function getFuzzyQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$phraseMatchBoost = $relevanceConfig->getPhraseMatchBoost();
$defaultSearchField = MappingInterface::DEFAULT_SPELLING_FIELD;
... | php | private function getFuzzyQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$phraseMatchBoost = $relevanceConfig->getPhraseMatchBoost();
$defaultSearchField = MappingInterface::DEFAULT_SPELLING_FIELD;
... | [
"private",
"function",
"getFuzzyQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
")",
"{",
"$",
"relevanceConfig",
"=",
"$",
"containerConfig",
"->",
"getRelevanceConfig",
"(",
")",
";",
"$",
"phraseMatchBoost",
"=",
"$"... | Fuzzy query part.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@return QueryInterface | [
"Fuzzy",
"query",
"part",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L237-L267 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getPhoneticQuery | private function getPhoneticQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$analyzer = FieldInterface::ANALYZER_PHONETIC;
$defaultSearchField = MappingInterface::DEFAULT_SPELLING_FIELD;
$fu... | php | private function getPhoneticQuery(ContainerConfigurationInterface $containerConfig, $queryText)
{
$relevanceConfig = $containerConfig->getRelevanceConfig();
$analyzer = FieldInterface::ANALYZER_PHONETIC;
$defaultSearchField = MappingInterface::DEFAULT_SPELLING_FIELD;
$fu... | [
"private",
"function",
"getPhoneticQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"queryText",
")",
"{",
"$",
"relevanceConfig",
"=",
"$",
"containerConfig",
"->",
"getRelevanceConfig",
"(",
")",
";",
"$",
"analyzer",
"=",
"FieldIn... | Phonentic query part.
@param ContainerConfigurationInterface $containerConfig Search request container configuration.
@param string $queryText The text query.
@return QueryInterface | [
"Phonentic",
"query",
"part",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L277-L295 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php | QueryBuilder.getWeightedFields | private function getWeightedFields(
ContainerConfigurationInterface $containerConfig,
$analyzer = null,
FieldFilterInterface $fieldFilter = null,
$defaultField = null,
$boost = 1
) {
$mapping = $containerConfig->getMapping();
return $mapping->getWeightedSear... | php | private function getWeightedFields(
ContainerConfigurationInterface $containerConfig,
$analyzer = null,
FieldFilterInterface $fieldFilter = null,
$defaultField = null,
$boost = 1
) {
$mapping = $containerConfig->getMapping();
return $mapping->getWeightedSear... | [
"private",
"function",
"getWeightedFields",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"$",
"analyzer",
"=",
"null",
",",
"FieldFilterInterface",
"$",
"fieldFilter",
"=",
"null",
",",
"$",
"defaultField",
"=",
"null",
",",
"$",
"boost",
"... | Build an array of weighted fields to be searched with the ability to apply a filter callback method and a default field.
@param ContainerConfigurationInterface $containerConfig Search request container config.
@param string $analyzer Target analyzer.
@param FieldFilterInterface ... | [
"Build",
"an",
"array",
"of",
"weighted",
"fields",
"to",
"be",
"searched",
"with",
"the",
"ability",
"to",
"apply",
"a",
"filter",
"callback",
"method",
"and",
"a",
"default",
"field",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/Query/Fulltext/QueryBuilder.php#L309-L320 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php | ApplierList.applyOptimizers | public function applyOptimizers(ContainerConfigurationInterface $containerConfiguration, QueryInterface $query)
{
$functions = $this->getFunctions($containerConfiguration);
if (isset($this->filters[$containerConfiguration->getName()])) {
$optimizerIds = $this->filters[$containerConfigur... | php | public function applyOptimizers(ContainerConfigurationInterface $containerConfiguration, QueryInterface $query)
{
$functions = $this->getFunctions($containerConfiguration);
if (isset($this->filters[$containerConfiguration->getName()])) {
$optimizerIds = $this->filters[$containerConfigur... | [
"public",
"function",
"applyOptimizers",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"QueryInterface",
"$",
"query",
")",
"{",
"$",
"functions",
"=",
"$",
"this",
"->",
"getFunctions",
"(",
"$",
"containerConfiguration",
")",
";",
"if... | Returns query.
@param ContainerConfigurationInterface $containerConfiguration Container configuration.
@param QueryInterface $query Query.
@return QueryInterface | [
"Returns",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php#L98-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php | ApplierList.applyFunctions | private function applyFunctions(QueryInterface $query, $functions = [])
{
if (!empty($functions)) {
$queryParams = [
'query' => $query,
'functions' => $functions,
'scoreMode' => FunctionScore::SCORE_MODE_MULTIPLY,
'boostMode' =>... | php | private function applyFunctions(QueryInterface $query, $functions = [])
{
if (!empty($functions)) {
$queryParams = [
'query' => $query,
'functions' => $functions,
'scoreMode' => FunctionScore::SCORE_MODE_MULTIPLY,
'boostMode' =>... | [
"private",
"function",
"applyFunctions",
"(",
"QueryInterface",
"$",
"query",
",",
"$",
"functions",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"functions",
")",
")",
"{",
"$",
"queryParams",
"=",
"[",
"'query'",
"=>",
"$",
"query",
... | Apply boost functions to a given query.
@param \Smile\ElasticsuiteCore\Search\Request\QueryInterface $query The Query
@param array $functions The boost functions
@return \Smile\ElasticsuiteCore\Search\Request\QueryInterface | [
"Apply",
"boost",
"functions",
"to",
"a",
"given",
"query",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php#L118-L131 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php | ApplierList.getFunctions | private function getFunctions(ContainerConfigurationInterface $containerConfiguration)
{
$containerName = $containerConfiguration->getName();
$storeId = $containerConfiguration->getStoreId();
$cacheKey = sprintf("%s_%s_%s", self::CACHE_KEY_PREFIX, $containerName, $storeId);
i... | php | private function getFunctions(ContainerConfigurationInterface $containerConfiguration)
{
$containerName = $containerConfiguration->getName();
$storeId = $containerConfiguration->getStoreId();
$cacheKey = sprintf("%s_%s_%s", self::CACHE_KEY_PREFIX, $containerName, $storeId);
i... | [
"private",
"function",
"getFunctions",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
")",
"{",
"$",
"containerName",
"=",
"$",
"containerConfiguration",
"->",
"getName",
"(",
")",
";",
"$",
"storeId",
"=",
"$",
"containerConfiguration",
"->",
... | Returns functions applied to the container.
@SuppressWarnings(PHPMD.ElseExpression)
@param ContainerConfigurationInterface $containerConfiguration Container configuration.
@return array | [
"Returns",
"functions",
"applied",
"to",
"the",
"container",
".",
"@SuppressWarnings",
"(",
"PHPMD",
".",
"ElseExpression",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php#L141-L164 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php | ApplierList.getOptimizersFunctions | private function getOptimizersFunctions(ContainerConfigurationInterface $containerConfiguration, $optimizers)
{
$functions = [];
foreach ($optimizers as $optimizer) {
$function = $this->getFunction($containerConfiguration, $optimizer);
if ($function !== null) {
... | php | private function getOptimizersFunctions(ContainerConfigurationInterface $containerConfiguration, $optimizers)
{
$functions = [];
foreach ($optimizers as $optimizer) {
$function = $this->getFunction($containerConfiguration, $optimizer);
if ($function !== null) {
... | [
"private",
"function",
"getOptimizersFunctions",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"$",
"optimizers",
")",
"{",
"$",
"functions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"optimizers",
"as",
"$",
"optimizer",
")",
"{",
"... | Retrieve optimizers functions for a given container
@param ContainerConfigurationInterface $containerConfiguration Container Configuration
@param Collection|OptimizerInterface[] $optimizers Optimizers list
@return array | [
"Retrieve",
"optimizers",
"functions",
"for",
"a",
"given",
"container"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php#L174-L187 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php | ApplierList.getFunction | private function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer)
{
$function = null;
$type = $optimizer->getModel();
if (isset($this->appliers[$type])) {
$function = $this->appliers[$type]->getFunction($containerConfigurati... | php | private function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer)
{
$function = null;
$type = $optimizer->getModel();
if (isset($this->appliers[$type])) {
$function = $this->appliers[$type]->getFunction($containerConfigurati... | [
"private",
"function",
"getFunction",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"OptimizerInterface",
"$",
"optimizer",
")",
"{",
"$",
"function",
"=",
"null",
";",
"$",
"type",
"=",
"$",
"optimizer",
"->",
"getModel",
"(",
")",
... | Build function score for a container / optimizer.
@param ContainerConfigurationInterface $containerConfiguration Container configuration.
@param OptimizerInterface $optimizer Optimizer.
@return mixed | [
"Build",
"function",
"score",
"for",
"a",
"container",
"/",
"optimizer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/ApplierList.php#L197-L207 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Helper/Rule.php | Rule.loadUsingCache | public function loadUsingCache(CategoryInterface $category, $callback)
{
\Magento\Framework\Profiler::start('ES:Virtual Rule ' . $callback);
$cacheKey = implode('|', [$callback, $category->getStoreId(), $category->getId()]);
$data = $this->cache->load($cacheKey);
// Due to the fact... | php | public function loadUsingCache(CategoryInterface $category, $callback)
{
\Magento\Framework\Profiler::start('ES:Virtual Rule ' . $callback);
$cacheKey = implode('|', [$callback, $category->getStoreId(), $category->getId()]);
$data = $this->cache->load($cacheKey);
// Due to the fact... | [
"public",
"function",
"loadUsingCache",
"(",
"CategoryInterface",
"$",
"category",
",",
"$",
"callback",
")",
"{",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Profiler",
"::",
"start",
"(",
"'ES:Virtual Rule '",
".",
"$",
"callback",
")",
";",
"$",
"cacheKey",
... | Load data from the cache if exist. Use a callback on the current category if not yet present into the cache.
@SuppressWarnings(PHPMD.StaticAccess)
@param CategoryInterface $category Category
@param string $callback Name of the virtual rule method to be used for actual loading.
@return mixed | [
"Load",
"data",
"from",
"the",
"cache",
"if",
"exist",
".",
"Use",
"a",
"callback",
"on",
"the",
"current",
"category",
"if",
"not",
"yet",
"present",
"into",
"the",
"cache",
".",
"@SuppressWarnings",
"(",
"PHPMD",
".",
"StaticAccess",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Helper/Rule.php#L52-L74 |
Smile-SA/elasticsuite | src/module-elasticsuite-tracker/Model/EventIndex.php | EventIndex.indexEvents | public function indexEvents($events)
{
$bulk = $this->indexOperation->createBulk();
$indices = [];
foreach ($events as $event) {
if (isset($event['page']['store_id'])) {
$index = $this->indexResolver->getIndex(self::INDEX_IDENTIFIER, $event['page']['store_id']... | php | public function indexEvents($events)
{
$bulk = $this->indexOperation->createBulk();
$indices = [];
foreach ($events as $event) {
if (isset($event['page']['store_id'])) {
$index = $this->indexResolver->getIndex(self::INDEX_IDENTIFIER, $event['page']['store_id']... | [
"public",
"function",
"indexEvents",
"(",
"$",
"events",
")",
"{",
"$",
"bulk",
"=",
"$",
"this",
"->",
"indexOperation",
"->",
"createBulk",
"(",
")",
";",
"$",
"indices",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"events",
"as",
"$",
"event",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-tracker/Model/EventIndex.php#L63-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.getPreviewObject | private function getPreviewObject()
{
$category = $this->getCategory();
$pageSize = $this->getPageSize();
$search = $this->getRequest()->getParam('search');
return $this->previewModelFactory->create(['category' => $category, 'size' => $pageSize, 'search' => $search]);
} | php | private function getPreviewObject()
{
$category = $this->getCategory();
$pageSize = $this->getPageSize();
$search = $this->getRequest()->getParam('search');
return $this->previewModelFactory->create(['category' => $category, 'size' => $pageSize, 'search' => $search]);
} | [
"private",
"function",
"getPreviewObject",
"(",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"getCategory",
"(",
")",
";",
"$",
"pageSize",
"=",
"$",
"this",
"->",
"getPageSize",
"(",
")",
";",
"$",
"search",
"=",
"$",
"this",
"->",
"getRequest",... | Load and initialize the preview model.
@return \Smile\ElasticsuiteVirtualCategory\Model\Preview | [
"Load",
"and",
"initialize",
"the",
"preview",
"model",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L90-L97 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.getCategory | private function getCategory()
{
$category = $this->loadCategory();
$this->addVirtualCategoryData($category)
->addSelectedProducts($category)
->setSortedProducts($category);
return $category;
} | php | private function getCategory()
{
$category = $this->loadCategory();
$this->addVirtualCategoryData($category)
->addSelectedProducts($category)
->setSortedProducts($category);
return $category;
} | [
"private",
"function",
"getCategory",
"(",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"loadCategory",
"(",
")",
";",
"$",
"this",
"->",
"addVirtualCategoryData",
"(",
"$",
"category",
")",
"->",
"addSelectedProducts",
"(",
"$",
"category",
")",
"->... | Load current category and apply admin current modifications (added and removed products, updated virtual rule, ...).
@return CategoryInterface | [
"Load",
"current",
"category",
"and",
"apply",
"admin",
"current",
"modifications",
"(",
"added",
"and",
"removed",
"products",
"updated",
"virtual",
"rule",
"...",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L104-L113 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.loadCategory | private function loadCategory()
{
$category = $this->categoryFactory->create();
$storeId = $this->getRequest()->getParam('store');
$categoryId = $this->getRequest()->getParam('entity_id');
$category->setStoreId($storeId)->load($categoryId);
return $category;
} | php | private function loadCategory()
{
$category = $this->categoryFactory->create();
$storeId = $this->getRequest()->getParam('store');
$categoryId = $this->getRequest()->getParam('entity_id');
$category->setStoreId($storeId)->load($categoryId);
return $category;
} | [
"private",
"function",
"loadCategory",
"(",
")",
"{",
"$",
"category",
"=",
"$",
"this",
"->",
"categoryFactory",
"->",
"create",
"(",
")",
";",
"$",
"storeId",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'store'",
")",
";",... | Load current category using the request params.
@return CategoryInterface | [
"Load",
"current",
"category",
"using",
"the",
"request",
"params",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L120-L129 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.addVirtualCategoryData | private function addVirtualCategoryData(CategoryInterface $category)
{
$isVirtualCategory = (bool) $this->getRequest()->getParam('is_virtual_category');
$category->setIsVirtualCategory($isVirtualCategory);
if ($isVirtualCategory) {
$category->getVirtualRule()->loadPost($this->ge... | php | private function addVirtualCategoryData(CategoryInterface $category)
{
$isVirtualCategory = (bool) $this->getRequest()->getParam('is_virtual_category');
$category->setIsVirtualCategory($isVirtualCategory);
if ($isVirtualCategory) {
$category->getVirtualRule()->loadPost($this->ge... | [
"private",
"function",
"addVirtualCategoryData",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"isVirtualCategory",
"=",
"(",
"bool",
")",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'is_virtual_category'",
")",
";",
"$",
"ca... | Append virtual rule params to the category.
@param CategoryInterface $category Category.
@return $this | [
"Append",
"virtual",
"rule",
"params",
"to",
"the",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L138-L149 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.addSelectedProducts | private function addSelectedProducts(CategoryInterface $category)
{
$selectedProducts = $this->getRequest()->getParam('selected_products', []);
$addedProducts = isset($selectedProducts['added_products']) ? $selectedProducts['added_products'] : [];
$category->setAddedProductIds($addedProduct... | php | private function addSelectedProducts(CategoryInterface $category)
{
$selectedProducts = $this->getRequest()->getParam('selected_products', []);
$addedProducts = isset($selectedProducts['added_products']) ? $selectedProducts['added_products'] : [];
$category->setAddedProductIds($addedProduct... | [
"private",
"function",
"addSelectedProducts",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"selectedProducts",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'selected_products'",
",",
"[",
"]",
")",
";",
"$",
"addedProduc... | Add user selected products.
@param CategoryInterface $category Category.
@return $this | [
"Add",
"user",
"selected",
"products",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L158-L169 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php | Preview.setSortedProducts | private function setSortedProducts(CategoryInterface $category)
{
$productPositions = $this->getRequest()->getParam('product_position', []);
$category->setSortedProductIds(array_keys($productPositions));
return $this;
} | php | private function setSortedProducts(CategoryInterface $category)
{
$productPositions = $this->getRequest()->getParam('product_position', []);
$category->setSortedProductIds(array_keys($productPositions));
return $this;
} | [
"private",
"function",
"setSortedProducts",
"(",
"CategoryInterface",
"$",
"category",
")",
"{",
"$",
"productPositions",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'product_position'",
",",
"[",
"]",
")",
";",
"$",
"category",
"... | Append products sorted by the user to the category.
@param CategoryInterface $category Category.
@return $this | [
"Append",
"products",
"sorted",
"by",
"the",
"user",
"to",
"the",
"category",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Controller/Adminhtml/Category/Virtual/Preview.php#L178-L184 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/Category/Attribute/VirtualRule/SaveHandler.php | SaveHandler.execute | public function execute($entity, $arguments = [])
{
$attributeData = $entity->getData(self::ATTRIBUTE_CODE);
if ($attributeData !== null) {
$rule = $this->ruleFactory->create();
if (is_object($attributeData)) {
$rule = $attributeData;
} elseif (i... | php | public function execute($entity, $arguments = [])
{
$attributeData = $entity->getData(self::ATTRIBUTE_CODE);
if ($attributeData !== null) {
$rule = $this->ruleFactory->create();
if (is_object($attributeData)) {
$rule = $attributeData;
} elseif (i... | [
"public",
"function",
"execute",
"(",
"$",
"entity",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"attributeData",
"=",
"$",
"entity",
"->",
"getData",
"(",
"self",
"::",
"ATTRIBUTE_CODE",
")",
";",
"if",
"(",
"$",
"attributeData",
"!==",
"null... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/Category/Attribute/VirtualRule/SaveHandler.php#L57-L77 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/ConstantScore.php | ConstantScore.getFunction | public function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer)
{
$function = [
'weight' => 1 + ((float) $optimizer->getConfig('constant_score_value') / 100),
'filter' => $optimizer->getRuleCondition()->getSearchQuery(),
];
... | php | public function getFunction(ContainerConfigurationInterface $containerConfiguration, OptimizerInterface $optimizer)
{
$function = [
'weight' => 1 + ((float) $optimizer->getConfig('constant_score_value') / 100),
'filter' => $optimizer->getRuleCondition()->getSearchQuery(),
];
... | [
"public",
"function",
"getFunction",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"OptimizerInterface",
"$",
"optimizer",
")",
"{",
"$",
"function",
"=",
"[",
"'weight'",
"=>",
"1",
"+",
"(",
"(",
"float",
")",
"$",
"optimizer",
"-... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Applier/ConstantScore.php#L32-L40 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Create.php | Create.execute | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->createPage();
$resultPage->setActiveMenu('Smile_ElasticsuiteCatalogOptimizer::optimizers');
$resultPage->getConfig()->getTitle()->prepend(__('New Optimizer'));
r... | php | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Page $resultPage */
$resultPage = $this->createPage();
$resultPage->setActiveMenu('Smile_ElasticsuiteCatalogOptimizer::optimizers');
$resultPage->getConfig()->getTitle()->prepend(__('New Optimizer'));
r... | [
"public",
"function",
"execute",
"(",
")",
"{",
"/** @var \\Magento\\Backend\\Model\\View\\Result\\Page $resultPage */",
"$",
"resultPage",
"=",
"$",
"this",
"->",
"createPage",
"(",
")",
";",
"$",
"resultPage",
"->",
"setActiveMenu",
"(",
"'Smile_ElasticsuiteCatalogOptim... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Controller/Adminhtml/Optimizer/Create.php#L31-L40 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php | CategoryData.getCategoryProductSelect | protected function getCategoryProductSelect($productIds, $storeId)
{
$select = $this->getConnection()->select()->union(
[
$this->getBaseSelectGlobal($productIds, $storeId),
$this->getBaseSelectStore($productIds, $storeId),
$this->getVirtualSelectGl... | php | protected function getCategoryProductSelect($productIds, $storeId)
{
$select = $this->getConnection()->select()->union(
[
$this->getBaseSelectGlobal($productIds, $storeId),
$this->getBaseSelectStore($productIds, $storeId),
$this->getVirtualSelectGl... | [
"protected",
"function",
"getCategoryProductSelect",
"(",
"$",
"productIds",
",",
"$",
"storeId",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
"->",
"union",
"(",
"[",
"$",
"this",
"->",
"getBaseSe... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php#L38-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php | CategoryData.getBaseSelectGlobal | private function getBaseSelectGlobal($productIds, $storeId)
{
$select = $this->getConnection()->select()
->from(['cpi' => $this->getTable($this->getCategoryProductIndexTable($storeId))], [])
->joinLeft(
['p' => $this->getTable(ProductPositionResourceModel::TABLE_NAME)... | php | private function getBaseSelectGlobal($productIds, $storeId)
{
$select = $this->getConnection()->select()
->from(['cpi' => $this->getTable($this->getCategoryProductIndexTable($storeId))], [])
->joinLeft(
['p' => $this->getTable(ProductPositionResourceModel::TABLE_NAME)... | [
"private",
"function",
"getBaseSelectGlobal",
"(",
"$",
"productIds",
",",
"$",
"storeId",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"(",
"[",
"'cpi'",
"=>",
"$",
"this",
"->",
... | Retrieve the standard categories product data (categories ids, positions, ...).
Product positions returned are those defined globally.
@param array $productIds Product ids.
@param int $storeId Store id.
@return \Zend_Db_Select | [
"Retrieve",
"the",
"standard",
"categories",
"product",
"data",
"(",
"categories",
"ids",
"positions",
"...",
")",
".",
"Product",
"positions",
"returned",
"are",
"those",
"defined",
"globally",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php#L61-L85 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php | CategoryData.joinStorePosition | private function joinStorePosition(\Magento\Framework\Db\Select &$select, $storeId, $useStorePositionsValue)
{
$useStorePositionsAttr = $this->getUseStorePositionsAttribute();
if ($useStorePositionsAttr && $useStorePositionsAttr->getAttributeId()) {
$linkField = $this->getEntityMetaDat... | php | private function joinStorePosition(\Magento\Framework\Db\Select &$select, $storeId, $useStorePositionsValue)
{
$useStorePositionsAttr = $this->getUseStorePositionsAttribute();
if ($useStorePositionsAttr && $useStorePositionsAttr->getAttributeId()) {
$linkField = $this->getEntityMetaDat... | [
"private",
"function",
"joinStorePosition",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Db",
"\\",
"Select",
"&",
"$",
"select",
",",
"$",
"storeId",
",",
"$",
"useStorePositionsValue",
")",
"{",
"$",
"useStorePositionsAttr",
"=",
"$",
"this",
"->",
"get... | Process left join on a select to the 'use_store_positions' attribute backend table.
@param \Magento\Framework\Db\Select $select The select to alter
@param int $storeId The store id
@param int $useStorePositionsValue The value of the use_s... | [
"Process",
"left",
"join",
"on",
"a",
"select",
"to",
"the",
"use_store_positions",
"attribute",
"backend",
"table",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php#L205-L232 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php | CategoryData.getUseStorePositionsAttribute | private function getUseStorePositionsAttribute()
{
$this->useStorePositionsAttribute = $this->getEavConfig()
->getAttribute(\Magento\Catalog\Model\Category::ENTITY, 'use_store_positions');
return $this->useStorePositionsAttribute;
} | php | private function getUseStorePositionsAttribute()
{
$this->useStorePositionsAttribute = $this->getEavConfig()
->getAttribute(\Magento\Catalog\Model\Category::ENTITY, 'use_store_positions');
return $this->useStorePositionsAttribute;
} | [
"private",
"function",
"getUseStorePositionsAttribute",
"(",
")",
"{",
"$",
"this",
"->",
"useStorePositionsAttribute",
"=",
"$",
"this",
"->",
"getEavConfig",
"(",
")",
"->",
"getAttribute",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category"... | Returns category attribute "use store positions"
@return \Magento\Eav\Model\Entity\Attribute\AbstractAttribute | [
"Returns",
"category",
"attribute",
"use",
"store",
"positions"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-virtual-category/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php#L239-L245 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Match.php | Match.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MATCH) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'query' => $query->getQu... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_MATCH) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'query' => $query->getQu... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_MATCH",
")",
"{",
"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/Match.php#L32-L51 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Price.php | Price._renderRangeLabel | protected function _renderRangeLabel($fromPrice, $toPrice)
{
$formattedPrice = $this->priceCurrency->format((float) $fromPrice * $this->getCurrencyRate());
if ($toPrice === '') {
$formattedPrice = __('%1 and above', $formattedPrice);
} elseif ($fromPrice != $toPrice || !$this->d... | php | protected function _renderRangeLabel($fromPrice, $toPrice)
{
$formattedPrice = $this->priceCurrency->format((float) $fromPrice * $this->getCurrencyRate());
if ($toPrice === '') {
$formattedPrice = __('%1 and above', $formattedPrice);
} elseif ($fromPrice != $toPrice || !$this->d... | [
"protected",
"function",
"_renderRangeLabel",
"(",
"$",
"fromPrice",
",",
"$",
"toPrice",
")",
"{",
"$",
"formattedPrice",
"=",
"$",
"this",
"->",
"priceCurrency",
"->",
"format",
"(",
"(",
"float",
")",
"$",
"fromPrice",
"*",
"$",
"this",
"->",
"getCurren... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Price.php#L109-L121 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/Filter/Price.php | Price.getRangeCondition | private function getRangeCondition($bounds)
{
$customerGroupId = $this->customerSession->getCustomerGroupId();
$priceQuery = $this->queryFactory->create(
QueryInterface::TYPE_NESTED,
[
'path' => 'price',
'query' => $this->queryFactory->create... | php | private function getRangeCondition($bounds)
{
$customerGroupId = $this->customerSession->getCustomerGroupId();
$priceQuery = $this->queryFactory->create(
QueryInterface::TYPE_NESTED,
[
'path' => 'price',
'query' => $this->queryFactory->create... | [
"private",
"function",
"getRangeCondition",
"(",
"$",
"bounds",
")",
"{",
"$",
"customerGroupId",
"=",
"$",
"this",
"->",
"customerSession",
"->",
"getCustomerGroupId",
"(",
")",
";",
"$",
"priceQuery",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"create",
... | Create the proper query filter for price, according to current customer group Id.
@SuppressWarnings(PHPMD.UnusedPrivateMethod)
@param array $bounds The price bounds to apply
@return \Smile\ElasticsuiteCore\Search\Request\QueryInterface | [
"Create",
"the",
"proper",
"query",
"filter",
"for",
"price",
"according",
"to",
"current",
"customer",
"group",
"Id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/Filter/Price.php#L144-L171 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Plugin/CatalogSearch/Indexer/FulltextPlugin.php | FulltextPlugin.afterExecuteFull | public function afterExecuteFull(\Magento\CatalogSearch\Model\Indexer\Fulltext $subject, $result)
{
try {
$this->frontendCachePool->get(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER)->clean(
\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG,
[\Smile\ElasticsuiteC... | php | public function afterExecuteFull(\Magento\CatalogSearch\Model\Indexer\Fulltext $subject, $result)
{
try {
$this->frontendCachePool->get(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER)->clean(
\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG,
[\Smile\ElasticsuiteC... | [
"public",
"function",
"afterExecuteFull",
"(",
"\\",
"Magento",
"\\",
"CatalogSearch",
"\\",
"Model",
"\\",
"Indexer",
"\\",
"Fulltext",
"$",
"subject",
",",
"$",
"result",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"frontendCachePool",
"->",
"get",
"(",
"\\... | After a full reindex of catalogsearch_fulltext index :
- cleanup the cache for items matching the popular search results tag.
@param \Magento\CatalogSearch\Model\Indexer\Fulltext $subject Catalog product fulltext indexer
@param void $result Void result
@return void
@SuppressW... | [
"After",
"a",
"full",
"reindex",
"of",
"catalogsearch_fulltext",
"index",
":",
"-",
"cleanup",
"the",
"cache",
"for",
"items",
"matching",
"the",
"popular",
"search",
"results",
"tag",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Plugin/CatalogSearch/Indexer/FulltextPlugin.php#L50-L60 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php | Builder.buildAggregations | public function buildAggregations(array $buckets = [])
{
$aggregations = [];
foreach ($buckets as $bucket) {
$bucketType = $bucket->getType();
$builder = $this->getBuilder($bucketType);
$aggregation = $builder->buildBucket($bucket);
$subAggrega... | php | public function buildAggregations(array $buckets = [])
{
$aggregations = [];
foreach ($buckets as $bucket) {
$bucketType = $bucket->getType();
$builder = $this->getBuilder($bucketType);
$aggregation = $builder->buildBucket($bucket);
$subAggrega... | [
"public",
"function",
"buildAggregations",
"(",
"array",
"$",
"buckets",
"=",
"[",
"]",
")",
"{",
"$",
"aggregations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"buckets",
"as",
"$",
"bucket",
")",
"{",
"$",
"bucketType",
"=",
"$",
"bucket",
"->",
"ge... | Build ES aggregations from search request buckets.
@param BucketInterface[] $buckets Bucket to be converted into ES aggregations
@return array | [
"Build",
"ES",
"aggregations",
"from",
"search",
"request",
"buckets",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php#L68-L122 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php | Builder.getBuilder | private function getBuilder($bucketType)
{
if (!isset($this->builders[$bucketType])) {
throw new \InvalidArgumentException("No builder found for aggregation type {$bucketType}.");
}
return $this->builders[$bucketType];
} | php | private function getBuilder($bucketType)
{
if (!isset($this->builders[$bucketType])) {
throw new \InvalidArgumentException("No builder found for aggregation type {$bucketType}.");
}
return $this->builders[$bucketType];
} | [
"private",
"function",
"getBuilder",
"(",
"$",
"bucketType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"builders",
"[",
"$",
"bucketType",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"No builder found for agg... | Retrieve the builder used to convert a bucket into ES aggregation.
@param string $bucketType Bucket type to be built.
@return BuilderInterface | [
"Retrieve",
"the",
"builder",
"used",
"to",
"convert",
"a",
"bucket",
"into",
"ES",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php#L131-L138 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php | Builder.getPipelineBuilder | private function getPipelineBuilder($pipelineType)
{
if (!isset($this->pipelineBuilders[$pipelineType])) {
throw new \InvalidArgumentException("No builder found for pipeline aggregation type {$pipelineType}.");
}
return $this->pipelineBuilders[$pipelineType];
} | php | private function getPipelineBuilder($pipelineType)
{
if (!isset($this->pipelineBuilders[$pipelineType])) {
throw new \InvalidArgumentException("No builder found for pipeline aggregation type {$pipelineType}.");
}
return $this->pipelineBuilders[$pipelineType];
} | [
"private",
"function",
"getPipelineBuilder",
"(",
"$",
"pipelineType",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"pipelineBuilders",
"[",
"$",
"pipelineType",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"No b... | Retrieve the builder used to convert a pipeline into an ES aggregation.
@param string $pipelineType Pipeline type to be built.
@return PipelineBuilderInterface | [
"Retrieve",
"the",
"builder",
"used",
"to",
"convert",
"a",
"pipeline",
"into",
"an",
"ES",
"aggregation",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder.php#L147-L154 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Block/Navigation/Renderer/AbstractRenderer.php | AbstractRenderer.render | public function render(FilterInterface $filter)
{
$html = '';
$this->filter = $filter;
if ($this->canRenderFilter()) {
$this->assign('filterItems', $filter->getItems());
$html = $this->_toHtml();
$this->assign('filterItems', []);
}
... | php | public function render(FilterInterface $filter)
{
$html = '';
$this->filter = $filter;
if ($this->canRenderFilter()) {
$this->assign('filterItems', $filter->getItems());
$html = $this->_toHtml();
$this->assign('filterItems', []);
}
... | [
"public",
"function",
"render",
"(",
"FilterInterface",
"$",
"filter",
")",
"{",
"$",
"html",
"=",
"''",
";",
"$",
"this",
"->",
"filter",
"=",
"$",
"filter",
";",
"if",
"(",
"$",
"this",
"->",
"canRenderFilter",
"(",
")",
")",
"{",
"$",
"this",
"-... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Block/Navigation/Renderer/AbstractRenderer.php#L57-L69 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Create.php | Create._construct | protected function _construct()
{
$this->_objectId = 'id';
$this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
$this->_controller = 'adminhtml_thesaurus';
parent::_construct();
$this->buttonList->update('save', 'label', __('Create Thesaurus'));
} | php | protected function _construct()
{
$this->_objectId = 'id';
$this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
$this->_controller = 'adminhtml_thesaurus';
parent::_construct();
$this->buttonList->update('save', 'label', __('Create Thesaurus'));
} | [
"protected",
"function",
"_construct",
"(",
")",
"{",
"$",
"this",
"->",
"_objectId",
"=",
"'id'",
";",
"$",
"this",
"->",
"_blockGroup",
"=",
"'Smile_ElasticsuiteThesaurus'",
";",
"$",
"this",
"->",
"_controller",
"=",
"'adminhtml_thesaurus'",
";",
"parent",
... | Internal constructor
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return void | [
"Internal",
"constructor"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Create.php#L59-L68 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Setup/UpgradeData.php | UpgradeData.upgrade | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
if (version_compare($context->getVersion(), '1.2.0', '<')) {
$this->catalogSetup->updateCategorySear... | php | public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
if (version_compare($context->getVersion(), '1.2.0', '<')) {
$this->catalogSetup->updateCategorySear... | [
"public",
"function",
"upgrade",
"(",
"ModuleDataSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"eavSetup",
"=",
"$",
"this",
"->",
"eavSetupFactory",
"->",
"create"... | 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-catalog/Setup/UpgradeData.php#L64-L82 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.loadAttributesRawData | protected function loadAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
{
return $this->resourceModel->getAttributesRawData($storeId, $entityIds, $tableName, $attributeIds);
} | php | protected function loadAttributesRawData($storeId, array $entityIds, $tableName, array $attributeIds)
{
return $this->resourceModel->getAttributesRawData($storeId, $entityIds, $tableName, $attributeIds);
} | [
"protected",
"function",
"loadAttributesRawData",
"(",
"$",
"storeId",
",",
"array",
"$",
"entityIds",
",",
"$",
"tableName",
",",
"array",
"$",
"attributeIds",
")",
"{",
"return",
"$",
"this",
"->",
"resourceModel",
"->",
"getAttributesRawData",
"(",
"$",
"st... | Load attribute data from the database.
@param integer $storeId Store id.
@param array $entityIds Entity ids.
@param string $tableName Attribute table name.
@param array $attributeIds Loaded attribute ids.
@return array | [
"Load",
"attribute",
"data",
"from",
"the",
"database",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L122-L125 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.initAttributes | private function initAttributes()
{
$attributeCollection = $this->attributeHelper->getAttributeCollection();
$this->resourceModel->addIndexedFilterToAttributeCollection($attributeCollection);
foreach ($attributeCollection as $attribute) {
if ($this->canIndexAttribute($attribute)... | php | private function initAttributes()
{
$attributeCollection = $this->attributeHelper->getAttributeCollection();
$this->resourceModel->addIndexedFilterToAttributeCollection($attributeCollection);
foreach ($attributeCollection as $attribute) {
if ($this->canIndexAttribute($attribute)... | [
"private",
"function",
"initAttributes",
"(",
")",
"{",
"$",
"attributeCollection",
"=",
"$",
"this",
"->",
"attributeHelper",
"->",
"getAttributeCollection",
"(",
")",
";",
"$",
"this",
"->",
"resourceModel",
"->",
"addIndexedFilterToAttributeCollection",
"(",
"$",... | Init attributes used into ES.
@return \Smile\ElasticsuiteCatalog\Model\Eav\Indexer\Fulltext\Datasource\AbstractAttributeData | [
"Init",
"attributes",
"used",
"into",
"ES",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L132-L153 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.canIndexAttribute | private function canIndexAttribute(AttributeInterface $attribute)
{
// 'price' attribute is declared as nested field into the indices file.
$canIndex = $attribute->getBackendType() != 'static' && $attribute->getAttributeCode() !== 'price';
if ($canIndex && $attribute->getBackendModel()) {
... | php | private function canIndexAttribute(AttributeInterface $attribute)
{
// 'price' attribute is declared as nested field into the indices file.
$canIndex = $attribute->getBackendType() != 'static' && $attribute->getAttributeCode() !== 'price';
if ($canIndex && $attribute->getBackendModel()) {
... | [
"private",
"function",
"canIndexAttribute",
"(",
"AttributeInterface",
"$",
"attribute",
")",
"{",
"// 'price' attribute is declared as nested field into the indices file.",
"$",
"canIndex",
"=",
"$",
"attribute",
"->",
"getBackendType",
"(",
")",
"!=",
"'static'",
"&&",
... | Check if an attribute can be indexed.
@param AttributeInterface $attribute Entity attribute.
@return boolean | [
"Check",
"if",
"an",
"attribute",
"can",
"be",
"indexed",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L162-L177 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php | AbstractAttributeData.initField | private function initField(AttributeInterface $attribute)
{
$fieldName = $attribute->getAttributeCode();
$fieldConfig = $this->attributeHelper->getMappingFieldOptions($attribute);
if ($attribute->usesSource()) {
$optionFieldName = $this->attributeHelper->getOptionTextFieldName($... | php | private function initField(AttributeInterface $attribute)
{
$fieldName = $attribute->getAttributeCode();
$fieldConfig = $this->attributeHelper->getMappingFieldOptions($attribute);
if ($attribute->usesSource()) {
$optionFieldName = $this->attributeHelper->getOptionTextFieldName($... | [
"private",
"function",
"initField",
"(",
"AttributeInterface",
"$",
"attribute",
")",
"{",
"$",
"fieldName",
"=",
"$",
"attribute",
"->",
"getAttributeCode",
"(",
")",
";",
"$",
"fieldConfig",
"=",
"$",
"this",
"->",
"attributeHelper",
"->",
"getMappingFieldOpti... | Create a mapping field from an attribute.
@param AttributeInterface $attribute Entity attribute.
@return \Smile\ElasticsuiteCatalog\Model\Eav\Indexer\Fulltext\Datasource\AbstractAttributeData | [
"Create",
"a",
"mapping",
"field",
"from",
"an",
"attribute",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Eav/Indexer/Fulltext/Datasource/AbstractAttributeData.php#L186-L208 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Edit.php | Edit._construct | protected function _construct()
{
$this->_objectId = ThesaurusInterface::THESAURUS_ID;
$this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
$this->_controller = 'adminhtml_thesaurus';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Thesaurus'));
... | php | protected function _construct()
{
$this->_objectId = ThesaurusInterface::THESAURUS_ID;
$this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
$this->_controller = 'adminhtml_thesaurus';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Thesaurus'));
... | [
"protected",
"function",
"_construct",
"(",
")",
"{",
"$",
"this",
"->",
"_objectId",
"=",
"ThesaurusInterface",
"::",
"THESAURUS_ID",
";",
"$",
"this",
"->",
"_blockGroup",
"=",
"'Smile_ElasticsuiteThesaurus'",
";",
"$",
"this",
"->",
"_controller",
"=",
"'admi... | Internal constructor
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return void | [
"Internal",
"constructor"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Edit.php#L57-L81 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Autocomplete/Terms/DataProvider.php | DataProvider.getItems | public function getItems()
{
if ($this->items === null) {
$collection = $this->getSuggestCollection();
$this->items = [];
if ($this->configurationHelper->isEnabled($this->getType())) {
foreach ($collection as $item) {
$resultItem = $th... | php | public function getItems()
{
if ($this->items === null) {
$collection = $this->getSuggestCollection();
$this->items = [];
if ($this->configurationHelper->isEnabled($this->getType())) {
foreach ($collection as $item) {
$resultItem = $th... | [
"public",
"function",
"getItems",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"items",
"===",
"null",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"getSuggestCollection",
"(",
")",
";",
"$",
"this",
"->",
"items",
"=",
"[",
"]",
";",
"if",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Autocomplete/Terms/DataProvider.php#L97-L116 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Autocomplete/Terms/DataProvider.php | DataProvider.getSuggestCollection | private function getSuggestCollection()
{
$queryCollection = $this->queryFactory->get()->getSuggestCollection();
$queryCollection->addFieldToFilter('is_spellchecked', 'false')->setPageSize($this->getResultsPageSize());
return $queryCollection;
} | php | private function getSuggestCollection()
{
$queryCollection = $this->queryFactory->get()->getSuggestCollection();
$queryCollection->addFieldToFilter('is_spellchecked', 'false')->setPageSize($this->getResultsPageSize());
return $queryCollection;
} | [
"private",
"function",
"getSuggestCollection",
"(",
")",
"{",
"$",
"queryCollection",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"get",
"(",
")",
"->",
"getSuggestCollection",
"(",
")",
";",
"$",
"queryCollection",
"->",
"addFieldToFilter",
"(",
"'is_spellche... | Retrieve suggest collection for query
@return Collection | [
"Retrieve",
"suggest",
"collection",
"for",
"query"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Autocomplete/Terms/DataProvider.php#L123-L129 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Search/Query.php | Query.saveSearchResults | public function saveSearchResults(QueryModel $query)
{
$adapter = $this->getConnection();
$table = $this->getMainTable();
$numResults = $query->getNumResults();
$isSpellchecked = (int) $query->getIsSpellchecked();
$saveData = [
'store_id' => $query->g... | php | public function saveSearchResults(QueryModel $query)
{
$adapter = $this->getConnection();
$table = $this->getMainTable();
$numResults = $query->getNumResults();
$isSpellchecked = (int) $query->getIsSpellchecked();
$saveData = [
'store_id' => $query->g... | [
"public",
"function",
"saveSearchResults",
"(",
"QueryModel",
"$",
"query",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"table",
"=",
"$",
"this",
"->",
"getMainTable",
"(",
")",
";",
"$",
"numResults",
"=",
"... | Save query with number of results and is spellchecked.
@param QueryModel $query Search query object.
@return void | [
"Save",
"query",
"with",
"number",
"of",
"results",
"and",
"is",
"spellchecked",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Search/Query.php#L35-L53 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/CategoryData.php | CategoryData.addData | public function addData($storeId, array $indexData)
{
$categoryData = $this->resourceModel->loadCategoryData($storeId, array_keys($indexData));
foreach ($categoryData as $categoryDataRow) {
$productId = (int) $categoryDataRow['product_id'];
unset($categoryDataRow['product_id... | php | public function addData($storeId, array $indexData)
{
$categoryData = $this->resourceModel->loadCategoryData($storeId, array_keys($indexData));
foreach ($categoryData as $categoryDataRow) {
$productId = (int) $categoryDataRow['product_id'];
unset($categoryDataRow['product_id... | [
"public",
"function",
"addData",
"(",
"$",
"storeId",
",",
"array",
"$",
"indexData",
")",
"{",
"$",
"categoryData",
"=",
"$",
"this",
"->",
"resourceModel",
"->",
"loadCategoryData",
"(",
"$",
"storeId",
",",
"array_keys",
"(",
"$",
"indexData",
")",
")",... | Add categories data to the index data.
{@inheritdoc} | [
"Add",
"categories",
"data",
"to",
"the",
"index",
"data",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Product/Indexer/Fulltext/Datasource/CategoryData.php#L49-L78 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php | SortOrderBuilder.buildSordOrders | public function buildSordOrders(ContainerConfigurationInterface $containerConfig, array $orders)
{
$sortOrders = [];
$mapping = $containerConfig->getMapping();
$orders = $this->addDefaultSortOrders($orders, $mapping);
foreach ($orders as $fieldName => $sortOrderParams) {
... | php | public function buildSordOrders(ContainerConfigurationInterface $containerConfig, array $orders)
{
$sortOrders = [];
$mapping = $containerConfig->getMapping();
$orders = $this->addDefaultSortOrders($orders, $mapping);
foreach ($orders as $fieldName => $sortOrderParams) {
... | [
"public",
"function",
"buildSordOrders",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfig",
",",
"array",
"$",
"orders",
")",
"{",
"$",
"sortOrders",
"=",
"[",
"]",
";",
"$",
"mapping",
"=",
"$",
"containerConfig",
"->",
"getMapping",
"(",
")",
";... | Build sort orders from array of sort orders definition.
@param ContainerConfigurationInterface $containerConfig Request configuration.
@param array $orders Sort orders definitions.
@return SortOrderInterface[] | [
"Build",
"sort",
"orders",
"from",
"array",
"of",
"sort",
"orders",
"definition",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php#L72-L106 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php | SortOrderBuilder.addDefaultSortOrders | private function addDefaultSortOrders($orders, MappingInterface $mapping)
{
$defaultOrders = [
SortOrderInterface::DEFAULT_SORT_FIELD => SortOrderInterface::SORT_DESC,
$mapping->getIdField()->getName() => SortOrderInterface::SORT_DESC,
];
if (count($orders) > 0)... | php | private function addDefaultSortOrders($orders, MappingInterface $mapping)
{
$defaultOrders = [
SortOrderInterface::DEFAULT_SORT_FIELD => SortOrderInterface::SORT_DESC,
$mapping->getIdField()->getName() => SortOrderInterface::SORT_DESC,
];
if (count($orders) > 0)... | [
"private",
"function",
"addDefaultSortOrders",
"(",
"$",
"orders",
",",
"MappingInterface",
"$",
"mapping",
")",
"{",
"$",
"defaultOrders",
"=",
"[",
"SortOrderInterface",
"::",
"DEFAULT_SORT_FIELD",
"=>",
"SortOrderInterface",
"::",
"SORT_DESC",
",",
"$",
"mapping"... | Append default sort to all queries to get fully predictable search results.
Order by _score first and then by the id field.
@param array $orders Original orders.
@param MappingInterface $mapping Mapping.
@return array | [
"Append",
"default",
"sort",
"to",
"all",
"queries",
"to",
"get",
"fully",
"predictable",
"search",
"results",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php#L118-L140 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php | SortOrderBuilder.getSortOrderParams | private function getSortOrderParams(FieldInterface $field, array $sortOrderParams)
{
$sortOrderParams['field'] = $field->getMappingProperty(FieldInterface::ANALYZER_SORTABLE);
$sortOrderParams['missing'] = $field->getSortMissing($sortOrderParams['direction']);
if ($field->isNested() && !i... | php | private function getSortOrderParams(FieldInterface $field, array $sortOrderParams)
{
$sortOrderParams['field'] = $field->getMappingProperty(FieldInterface::ANALYZER_SORTABLE);
$sortOrderParams['missing'] = $field->getSortMissing($sortOrderParams['direction']);
if ($field->isNested() && !i... | [
"private",
"function",
"getSortOrderParams",
"(",
"FieldInterface",
"$",
"field",
",",
"array",
"$",
"sortOrderParams",
")",
"{",
"$",
"sortOrderParams",
"[",
"'field'",
"]",
"=",
"$",
"field",
"->",
"getMappingProperty",
"(",
"FieldInterface",
"::",
"ANALYZER_SOR... | Retrieve base params for a sort order field.
@param FieldInterface $field Sort order field.
@param array $sortOrderParams Sort order params.
@return array | [
"Retrieve",
"base",
"params",
"for",
"a",
"sort",
"order",
"field",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php#L150-L160 |
Smile-SA/elasticsuite | src/module-elasticsuite-virtual-category/Setup/InstallData.php | InstallData.install | public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$this->virtualCategorySetup->createVirtualCategoriesAttributes($eavSetup);
$setup->endSetup();
} | php | public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$this->virtualCategorySetup->createVirtualCategoriesAttributes($eavSetup);
$setup->endSetup();
} | [
"public",
"function",
"install",
"(",
"ModuleDataSetupInterface",
"$",
"setup",
",",
"ModuleContextInterface",
"$",
"context",
")",
"{",
"$",
"setup",
"->",
"startSetup",
"(",
")",
";",
"$",
"eavSetup",
"=",
"$",
"this",
"->",
"eavSetupFactory",
"->",
"create"... | @SuppressWarnings(PHPMD.UnusedFormalParameter)
Append virtual category related attributes :
- is_virtual_category
- virtual_rule
@param ModuleDataSetupInterface $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-virtual-category/Setup/InstallData.php#L68-L76 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/Report.php | Report.processResponse | protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response)
{
$data = array_merge(array_fill_keys($this->defaultKeys, 0), ['page_views_count' => $response->count()]);
foreach ($this->getBucketValues($response) as $value) {
if ... | php | protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response)
{
$data = array_merge(array_fill_keys($this->defaultKeys, 0), ['page_views_count' => $response->count()]);
foreach ($this->getBucketValues($response) as $value) {
if ... | [
"protected",
"function",
"processResponse",
"(",
"\\",
"Smile",
"\\",
"ElasticsuiteCore",
"\\",
"Search",
"\\",
"Adapter",
"\\",
"Elasticsuite",
"\\",
"Response",
"\\",
"QueryResponse",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"array_merge",
"(",
"array_fill... | {@inheritdoc}
@SuppressWarnings(PHPMD.ElseExpression) | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Model/Search/Usage/Kpi/Report.php#L44-L62 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/Edit.php | Edit.execute | public function execute()
{
$current = $this->getRequest()->getParam('section');
$container = $this->getRequest()->getParam('container');
$store = $this->getRequest()->getParam('store');
/** @var $section \Magento\Config\Model\Config\Structure\Element\Section */
$section = $... | php | public function execute()
{
$current = $this->getRequest()->getParam('section');
$container = $this->getRequest()->getParam('container');
$store = $this->getRequest()->getParam('store');
/** @var $section \Magento\Config\Model\Config\Structure\Element\Section */
$section = $... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'section'",
")",
";",
"$",
"container",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"getParam",
"(",
"'c... | Edit configuration section
@return \Magento\Framework\App\ResponseInterface|void | [
"Edit",
"configuration",
"section"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Controller/Adminhtml/Search/Request/RelevanceConfig/Edit.php#L62-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.setOrder | public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
{
$this->_orders[$attribute] = $dir;
return $this;
} | php | public function setOrder($attribute, $dir = self::SORT_ORDER_DESC)
{
$this->_orders[$attribute] = $dir;
return $this;
} | [
"public",
"function",
"setOrder",
"(",
"$",
"attribute",
",",
"$",
"dir",
"=",
"self",
"::",
"SORT_ORDER_DESC",
")",
"{",
"$",
"this",
"->",
"_orders",
"[",
"$",
"attribute",
"]",
"=",
"$",
"dir",
";",
"return",
"$",
"this",
";",
"}"
] | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L194-L199 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.addFieldToFilter | public function addFieldToFilter($field, $condition = null)
{
$field = $this->mapFieldName($field);
$this->filters[$field] = $condition;
return $this;
} | php | public function addFieldToFilter($field, $condition = null)
{
$field = $this->mapFieldName($field);
$this->filters[$field] = $condition;
return $this;
} | [
"public",
"function",
"addFieldToFilter",
"(",
"$",
"field",
",",
"$",
"condition",
"=",
"null",
")",
"{",
"$",
"field",
"=",
"$",
"this",
"->",
"mapFieldName",
"(",
"$",
"field",
")",
";",
"$",
"this",
"->",
"filters",
"[",
"$",
"field",
"]",
"=",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L216-L222 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.addAttributeToSort | public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
{
if ($attribute !== 'entity_id') {
return $this->setOrder($attribute, $dir);
}
return $this;
} | php | public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC)
{
if ($attribute !== 'entity_id') {
return $this->setOrder($attribute, $dir);
}
return $this;
} | [
"public",
"function",
"addAttributeToSort",
"(",
"$",
"attribute",
",",
"$",
"dir",
"=",
"self",
"::",
"SORT_ORDER_ASC",
")",
"{",
"if",
"(",
"$",
"attribute",
"!==",
"'entity_id'",
")",
"{",
"return",
"$",
"this",
"->",
"setOrder",
"(",
"$",
"attribute",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L227-L234 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.getFacetedData | public function getFacetedData($field)
{
$this->_renderFilters();
$result = [];
$aggregations = $this->queryResponse->getAggregations();
$bucket = $aggregations->getBucket($field);
if ($bucket) {
foreach ($bucket->getValues() as $value) {
$metric... | php | public function getFacetedData($field)
{
$this->_renderFilters();
$result = [];
$aggregations = $this->queryResponse->getAggregations();
$bucket = $aggregations->getBucket($field);
if ($bucket) {
foreach ($bucket->getValues() as $value) {
$metric... | [
"public",
"function",
"getFacetedData",
"(",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"_renderFilters",
"(",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"aggregations",
"=",
"$",
"this",
"->",
"queryResponse",
"->",
"getAggregations",
"(",
")",
... | Return field faceted data from faceted search result.
@param string $field Facet field.
@return array | [
"Return",
"field",
"faceted",
"data",
"from",
"faceted",
"search",
"result",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L285-L301 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.addCategoryFilter | public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
{
$categoryId = $category;
if (is_object($category)) {
$categoryId = $category->getId();
}
$this->addFieldToFilter('category_ids', $categoryId);
$this->_productLimitationFilters['catego... | php | public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
{
$categoryId = $category;
if (is_object($category)) {
$categoryId = $category->getId();
}
$this->addFieldToFilter('category_ids', $categoryId);
$this->_productLimitationFilters['catego... | [
"public",
"function",
"addCategoryFilter",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Category",
"$",
"category",
")",
"{",
"$",
"categoryId",
"=",
"$",
"category",
";",
"if",
"(",
"is_object",
"(",
"$",
"category",
")",
")",
"{",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L306-L318 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.addSortFilterParameters | public function addSortFilterParameters($sortName, $sortField, $nestedPath = null, $nestedFilter = null)
{
$sortParams = [];
if (isset($this->_productLimitationFilters['sortParams'])) {
$sortParams = $this->_productLimitationFilters['sortParams'];
}
$sortParams[$sortNam... | php | public function addSortFilterParameters($sortName, $sortField, $nestedPath = null, $nestedFilter = null)
{
$sortParams = [];
if (isset($this->_productLimitationFilters['sortParams'])) {
$sortParams = $this->_productLimitationFilters['sortParams'];
}
$sortParams[$sortNam... | [
"public",
"function",
"addSortFilterParameters",
"(",
"$",
"sortName",
",",
"$",
"sortField",
",",
"$",
"nestedPath",
"=",
"null",
",",
"$",
"nestedFilter",
"=",
"null",
")",
"{",
"$",
"sortParams",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"th... | Set param for a sort order.
@param string $sortName Sort order name (eg. position, ...).
@param string $sortField Sort field.
@param string $nestedPath Optional nested path for the sort field.
@param array $nestedFilter Optional nested filter for the sort field.
@return \Smile\ElasticsuiteCatalog\Model\Reso... | [
"Set",
"param",
"for",
"a",
"sort",
"order",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L362-L379 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection._renderFiltersBefore | protected function _renderFiltersBefore()
{
$searchRequest = $this->prepareRequest();
$this->queryResponse = $this->searchEngine->search($searchRequest);
// Update the product count.
$this->_totalRecords = $this->queryResponse->count();
// Filter search results. The pagina... | php | protected function _renderFiltersBefore()
{
$searchRequest = $this->prepareRequest();
$this->queryResponse = $this->searchEngine->search($searchRequest);
// Update the product count.
$this->_totalRecords = $this->queryResponse->count();
// Filter search results. The pagina... | [
"protected",
"function",
"_renderFiltersBefore",
"(",
")",
"{",
"$",
"searchRequest",
"=",
"$",
"this",
"->",
"prepareRequest",
"(",
")",
";",
"$",
"this",
"->",
"queryResponse",
"=",
"$",
"this",
"->",
"searchEngine",
"->",
"search",
"(",
"$",
"searchReques... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritdoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L386-L414 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection._afterLoad | protected function _afterLoad()
{
// Resort items according the search response.
$originalItems = $this->_items;
$this->_items = [];
foreach ($this->queryResponse->getIterator() as $document) {
$documentId = $document->getId();
if (isset($originalItems[$docu... | php | protected function _afterLoad()
{
// Resort items according the search response.
$originalItems = $this->_items;
$this->_items = [];
foreach ($this->queryResponse->getIterator() as $document) {
$documentId = $document->getId();
if (isset($originalItems[$docu... | [
"protected",
"function",
"_afterLoad",
"(",
")",
"{",
"// Resort items according the search response.",
"$",
"originalItems",
"=",
"$",
"this",
"->",
"_items",
";",
"$",
"this",
"->",
"_items",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"queryRespo... | @SuppressWarnings(PHPMD.CamelCaseMethodName)
{@inheritDoc} | [
"@SuppressWarnings",
"(",
"PHPMD",
".",
"CamelCaseMethodName",
")"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L444-L464 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.prepareRequest | private function prepareRequest()
{
// Store id and request name.
$storeId = $this->getStoreId();
$searchRequestName = $this->searchRequestName;
// Pagination params.
$size = $this->_pageSize ? $this->_pageSize : 0;
$from = $size * (max(1, $this->_curPage) ... | php | private function prepareRequest()
{
// Store id and request name.
$storeId = $this->getStoreId();
$searchRequestName = $this->searchRequestName;
// Pagination params.
$size = $this->_pageSize ? $this->_pageSize : 0;
$from = $size * (max(1, $this->_curPage) ... | [
"private",
"function",
"prepareRequest",
"(",
")",
"{",
"// Store id and request name.",
"$",
"storeId",
"=",
"$",
"this",
"->",
"getStoreId",
"(",
")",
";",
"$",
"searchRequestName",
"=",
"$",
"this",
"->",
"searchRequestName",
";",
"// Pagination params.",
"$",
... | Prepare the search request before it will be executed.
@return RequestInterface | [
"Prepare",
"the",
"search",
"request",
"before",
"it",
"will",
"be",
"executed",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L471-L497 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.prepareSortOrders | private function prepareSortOrders()
{
$sortOrders = [];
$useProductuctLimitation = isset($this->_productLimitationFilters['sortParams']);
foreach ($this->_orders as $attribute => $direction) {
$sortParams = ['direction' => $direction];
$sortField = $this->mapField... | php | private function prepareSortOrders()
{
$sortOrders = [];
$useProductuctLimitation = isset($this->_productLimitationFilters['sortParams']);
foreach ($this->_orders as $attribute => $direction) {
$sortParams = ['direction' => $direction];
$sortField = $this->mapField... | [
"private",
"function",
"prepareSortOrders",
"(",
")",
"{",
"$",
"sortOrders",
"=",
"[",
"]",
";",
"$",
"useProductuctLimitation",
"=",
"isset",
"(",
"$",
"this",
"->",
"_productLimitationFilters",
"[",
"'sortParams'",
"]",
")",
";",
"foreach",
"(",
"$",
"thi... | Prepare sort orders for the request builder.
@return array() | [
"Prepare",
"sort",
"orders",
"for",
"the",
"request",
"builder",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L504-L530 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php | Collection.mapFieldName | private function mapFieldName($fieldName)
{
if (isset($this->fieldNameMapping[$fieldName])) {
$fieldName = $this->fieldNameMapping[$fieldName];
}
return $fieldName;
} | php | private function mapFieldName($fieldName)
{
if (isset($this->fieldNameMapping[$fieldName])) {
$fieldName = $this->fieldNameMapping[$fieldName];
}
return $fieldName;
} | [
"private",
"function",
"mapFieldName",
"(",
"$",
"fieldName",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fieldNameMapping",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"$",
"fieldName",
"=",
"$",
"this",
"->",
"fieldNameMapping",
"[",
"$",
"... | Convert standard field name to ES fieldname.
(eg. category_ids => category.category_id).
@param string $fieldName Field name to be mapped.
@return string | [
"Convert",
"standard",
"field",
"name",
"to",
"ES",
"fieldname",
".",
"(",
"eg",
".",
"category_ids",
"=",
">",
"category",
".",
"category_id",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/ResourceModel/Product/Fulltext/Collection.php#L540-L547 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Create/Form.php | Form._prepareForm | protected function _prepareForm()
{
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create(
['data' => ['id' => 'edit_form', 'action' => $this->getData('action')]]
);
$thesaurusTypes = [
['value' => ThesaurusInterface::TYPE_SYNONYM... | php | protected function _prepareForm()
{
/** @var \Magento\Framework\Data\Form $form */
$form = $this->_formFactory->create(
['data' => ['id' => 'edit_form', 'action' => $this->getData('action')]]
);
$thesaurusTypes = [
['value' => ThesaurusInterface::TYPE_SYNONYM... | [
"protected",
"function",
"_prepareForm",
"(",
")",
"{",
"/** @var \\Magento\\Framework\\Data\\Form $form */",
"$",
"form",
"=",
"$",
"this",
"->",
"_formFactory",
"->",
"create",
"(",
"[",
"'data'",
"=>",
"[",
"'id'",
"=>",
"'edit_form'",
",",
"'action'",
"=>",
... | Prepare form fields
@SuppressWarnings(PHPMD.CamelCaseMethodName)
@return Form | [
"Prepare",
"form",
"fields"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Block/Adminhtml/Thesaurus/Create/Form.php#L48-L77 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php | ProductImage.beforeGetImage | public function beforeGetImage(
\Magento\Catalog\Block\Product\AbstractProduct $subject,
\Magento\Catalog\Model\Product $product,
$location,
array $attributes = []
) {
if ($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE
... | php | public function beforeGetImage(
\Magento\Catalog\Block\Product\AbstractProduct $subject,
\Magento\Catalog\Model\Product $product,
$location,
array $attributes = []
) {
if ($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE
... | [
"public",
"function",
"beforeGetImage",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Block",
"\\",
"Product",
"\\",
"AbstractProduct",
"$",
"subject",
",",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Product",
"$",
"product",
",",
"$",
"location... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php#L35-L53 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php | ProductImage.getFilterArray | private function getFilterArray(array $request, \Magento\Catalog\Model\Product $product)
{
$filterArray = [];
$attributes = $this->eavConfig->getEntityAttributes(\Magento\Catalog\Model\Product::ENTITY, $product);
foreach ($request as $code => $value) {
if (array_key_exists($code... | php | private function getFilterArray(array $request, \Magento\Catalog\Model\Product $product)
{
$filterArray = [];
$attributes = $this->eavConfig->getEntityAttributes(\Magento\Catalog\Model\Product::ENTITY, $product);
foreach ($request as $code => $value) {
if (array_key_exists($code... | [
"private",
"function",
"getFilterArray",
"(",
"array",
"$",
"request",
",",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"Product",
"$",
"product",
")",
"{",
"$",
"filterArray",
"=",
"[",
"]",
";",
"$",
"attributes",
"=",
"$",
"this",
"->",
"... | Get filters from request and replace labels by option ids.
@param array $request Request parameters.
@param \Magento\Catalog\Model\Product $product Product.
@return array | [
"Get",
"filters",
"from",
"request",
"and",
"replace",
"labels",
"by",
"option",
"ids",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php#L63-L86 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php | ProductImage.loadSimpleVariation | private function loadSimpleVariation(Product $parentProduct, array $filterArray)
{
$childProduct = $this->swatchHelperData->loadVariationByFallback($parentProduct, $filterArray);
if ($childProduct && !$childProduct->getImage()) {
$childProduct = $this->swatchHelperData->loadFirstVariatio... | php | private function loadSimpleVariation(Product $parentProduct, array $filterArray)
{
$childProduct = $this->swatchHelperData->loadVariationByFallback($parentProduct, $filterArray);
if ($childProduct && !$childProduct->getImage()) {
$childProduct = $this->swatchHelperData->loadFirstVariatio... | [
"private",
"function",
"loadSimpleVariation",
"(",
"Product",
"$",
"parentProduct",
",",
"array",
"$",
"filterArray",
")",
"{",
"$",
"childProduct",
"=",
"$",
"this",
"->",
"swatchHelperData",
"->",
"loadVariationByFallback",
"(",
"$",
"parentProduct",
",",
"$",
... | Load simple product variation of a given configurable product with swatches.
(copy/paste of parent method).
@param Product $parentProduct Parent configurable product.
@param array $filterArray Swatch attributes values.
@return bool|Product | [
"Load",
"simple",
"product",
"variation",
"of",
"a",
"given",
"configurable",
"product",
"with",
"swatches",
".",
"(",
"copy",
"/",
"paste",
"of",
"parent",
"method",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php#L97-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php | ProductImage.canReplaceImageWithSwatch | private function canReplaceImageWithSwatch($attribute)
{
$result = true;
if (!$this->swatchHelperData->isSwatchAttribute($attribute)) {
$result = false;
}
if (!$attribute->getUsedInProductListing()
|| !$attribute->getIsFilterable()
|| !$attribute-... | php | private function canReplaceImageWithSwatch($attribute)
{
$result = true;
if (!$this->swatchHelperData->isSwatchAttribute($attribute)) {
$result = false;
}
if (!$attribute->getUsedInProductListing()
|| !$attribute->getIsFilterable()
|| !$attribute-... | [
"private",
"function",
"canReplaceImageWithSwatch",
"(",
"$",
"attribute",
")",
"{",
"$",
"result",
"=",
"true",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"swatchHelperData",
"->",
"isSwatchAttribute",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"result",
"="... | Check if we can replace original image with swatch image on catalog/category/list page
(copy/paste of parent method).
@param Attribute $attribute Swatch attribute.
@return bool | [
"Check",
"if",
"we",
"can",
"replace",
"original",
"image",
"with",
"swatch",
"image",
"on",
"catalog",
"/",
"category",
"/",
"list",
"page",
"(",
"copy",
"/",
"paste",
"of",
"parent",
"method",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php#L118-L133 |
Smile-SA/elasticsuite | src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/ConversionRates.php | ConversionRates.getChartData | public function getChartData()
{
$data = [
'cols' => [
['type' => 'string', 'label' => __('Session type')],
['type' => 'number', 'label' => __('Conversion rate (%)')],
['type' => 'string', 'role' => 'style'],
],
'rows' => []... | php | public function getChartData()
{
$data = [
'cols' => [
['type' => 'string', 'label' => __('Session type')],
['type' => 'number', 'label' => __('Conversion rate (%)')],
['type' => 'string', 'role' => 'style'],
],
'rows' => []... | [
"public",
"function",
"getChartData",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'cols'",
"=>",
"[",
"[",
"'type'",
"=>",
"'string'",
",",
"'label'",
"=>",
"__",
"(",
"'Session type'",
")",
"]",
",",
"[",
"'type'",
"=>",
"'number'",
",",
"'label'",
"=>",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/ConversionRates.php#L78-L126 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php | Thesaurus.getSynonyms | public function getSynonyms($storeId)
{
$connection = $this->getConnection();
$select = $this->getBaseSelect($storeId, ThesaurusInterface::TYPE_SYNONYM);
$select->columns(['terms' => new \Zend_Db_Expr('GROUP_CONCAT(terms.term)')]);
return $connection->fetchCol($select);
} | php | public function getSynonyms($storeId)
{
$connection = $this->getConnection();
$select = $this->getBaseSelect($storeId, ThesaurusInterface::TYPE_SYNONYM);
$select->columns(['terms' => new \Zend_Db_Expr('GROUP_CONCAT(terms.term)')]);
return $connection->fetchCol($select);
} | [
"public",
"function",
"getSynonyms",
"(",
"$",
"storeId",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"getBaseSelect",
"(",
"$",
"storeId",
",",
"ThesaurusInterface",
"::",
"... | Build a list of synonyms into the Lucene format (foo,bar).
@param int $storeId Store id.
@return string[] | [
"Build",
"a",
"list",
"of",
"synonyms",
"into",
"the",
"Lucene",
"format",
"(",
"foo",
"bar",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php#L35-L43 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php | Thesaurus.getExpansions | public function getExpansions($storeId)
{
$connection = $this->getConnection();
$select = $this->getBaseSelect($storeId, ThesaurusInterface::TYPE_EXPANSION);
$select->join(
['expanded_terms' => $this->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME)],
'expanded... | php | public function getExpansions($storeId)
{
$connection = $this->getConnection();
$select = $this->getBaseSelect($storeId, ThesaurusInterface::TYPE_EXPANSION);
$select->join(
['expanded_terms' => $this->getTable(ThesaurusInterface::REFERENCE_TABLE_NAME)],
'expanded... | [
"public",
"function",
"getExpansions",
"(",
"$",
"storeId",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"select",
"=",
"$",
"this",
"->",
"getBaseSelect",
"(",
"$",
"storeId",
",",
"ThesaurusInterface",
"::",
... | Build a list of expansions into the Lucene format (foo => bar).
@param int $storeId Store id.
@return string[] | [
"Build",
"a",
"list",
"of",
"expansions",
"into",
"the",
"Lucene",
"format",
"(",
"foo",
"=",
">",
"bar",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php#L52-L66 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php | Thesaurus.getBaseSelect | private function getBaseSelect($storeId, $type)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from(['thesaurus' => $this->getMainTable()], [])
->join(
['terms' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)],
... | php | private function getBaseSelect($storeId, $type)
{
$connection = $this->getConnection();
$select = $connection->select();
$select->from(['thesaurus' => $this->getMainTable()], [])
->join(
['terms' => $this->getTable(ThesaurusInterface::EXPANSION_TABLE_NAME)],
... | [
"private",
"function",
"getBaseSelect",
"(",
"$",
"storeId",
",",
"$",
"type",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"getConnection",
"(",
")",
";",
"$",
"select",
"=",
"$",
"connection",
"->",
"select",
"(",
")",
";",
"$",
"select",
"... | Base select for thesaurus terms select by store id.
@param int $storeId Store id.
@param string $type Type of thesaurus (synonym or expansion).
@return \Magento\Framework\DB\Select | [
"Base",
"select",
"for",
"thesaurus",
"terms",
"select",
"by",
"store",
"id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Model/ResourceModel/Indexer/Thesaurus.php#L76-L98 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/SearchQuery.php | SearchQuery.getFullTextQuery | public function getFullTextQuery($containerConfiguration, $queryText)
{
$spellingType = $this->getSpellingType($containerConfiguration, $queryText);
$query = $this->createFullTextQuery($containerConfiguration, $queryText, $spellingType);
$filterQuery = $this->queryBuilder->createFilt... | php | public function getFullTextQuery($containerConfiguration, $queryText)
{
$spellingType = $this->getSpellingType($containerConfiguration, $queryText);
$query = $this->createFullTextQuery($containerConfiguration, $queryText, $spellingType);
$filterQuery = $this->queryBuilder->createFilt... | [
"public",
"function",
"getFullTextQuery",
"(",
"$",
"containerConfiguration",
",",
"$",
"queryText",
")",
"{",
"$",
"spellingType",
"=",
"$",
"this",
"->",
"getSpellingType",
"(",
"$",
"containerConfiguration",
",",
"$",
"queryText",
")",
";",
"$",
"query",
"=... | Retrieve Fulltext search Query for a given query Text
@param ContainerConfigurationInterface $containerConfiguration Search request container configuration.
@param string $queryText The Query Text
@return \Smile\ElasticsuiteCore\Search\Request\QueryInterface | [
"Retrieve",
"Fulltext",
"search",
"Query",
"for",
"a",
"given",
"query",
"Text"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/SearchQuery.php#L80-L87 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/SearchQuery.php | SearchQuery.createFullTextQuery | private function createFullTextQuery(
ContainerConfigurationInterface $containerConfiguration,
$queryText,
$spellingType
) {
$queryParams = [];
$queryParams['query'] = $this->queryBuilder->createFulltextQuery($containerConfiguration, $queryText, $spellingType);
... | php | private function createFullTextQuery(
ContainerConfigurationInterface $containerConfiguration,
$queryText,
$spellingType
) {
$queryParams = [];
$queryParams['query'] = $this->queryBuilder->createFulltextQuery($containerConfiguration, $queryText, $spellingType);
... | [
"private",
"function",
"createFullTextQuery",
"(",
"ContainerConfigurationInterface",
"$",
"containerConfiguration",
",",
"$",
"queryText",
",",
"$",
"spellingType",
")",
"{",
"$",
"queryParams",
"=",
"[",
"]",
";",
"$",
"queryParams",
"[",
"'query'",
"]",
"=",
... | Create a filtered query with an optional fulltext query part.
@param ContainerConfigurationInterface $containerConfiguration Search request container configuration.
@param string|null $queryText Fulltext query.
@param string $spellingType For fulltext... | [
"Create",
"a",
"filtered",
"query",
"with",
"an",
"optional",
"fulltext",
"query",
"part",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/SearchQuery.php#L99-L108 |
Smile-SA/elasticsuite | src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Save.php | Save.execute | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
$data = $this->getRequest()->getPostValue();
$redirectBack = $this->getRequest()->getParam('back', false);
i... | php | public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
$data = $this->getRequest()->getPostValue();
$redirectBack = $this->getRequest()->getParam('back', false);
i... | [
"public",
"function",
"execute",
"(",
")",
"{",
"/** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */",
"$",
"resultRedirect",
"=",
"$",
"this",
"->",
"resultRedirectFactory",
"->",
"create",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",... | Save a Thesaurus
@return \Magento\Backend\Model\View\Result\Redirect | [
"Save",
"a",
"Thesaurus"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-thesaurus/Controller/Adminhtml/Thesaurus/Save.php#L33-L84 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/SaveHandler.php | SaveHandler.execute | public function execute($entity, $arguments = [])
{
$categoryIds = $this->getCategoryIdsLimitation($entity);
$queryIds = $this->getQueryIdsLimitation($entity);
$limitationData = [];
foreach ($categoryIds as $categoryId) {
$limitationData[] = ['category_id' => $catego... | php | public function execute($entity, $arguments = [])
{
$categoryIds = $this->getCategoryIdsLimitation($entity);
$queryIds = $this->getQueryIdsLimitation($entity);
$limitationData = [];
foreach ($categoryIds as $categoryId) {
$limitationData[] = ['category_id' => $catego... | [
"public",
"function",
"execute",
"(",
"$",
"entity",
",",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"categoryIds",
"=",
"$",
"this",
"->",
"getCategoryIdsLimitation",
"(",
"$",
"entity",
")",
";",
"$",
"queryIds",
"=",
"$",
"this",
"->",
"getQuer... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/SaveHandler.php#L46-L64 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/SaveHandler.php | SaveHandler.getCategoryIdsLimitation | private function getCategoryIdsLimitation($entity)
{
$searchContainerData = $entity->getData('catalog_view_container');
$applyTo = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
$categoryIds = ($applyTo === false) ? [] : $searchContainerData[... | php | private function getCategoryIdsLimitation($entity)
{
$searchContainerData = $entity->getData('catalog_view_container');
$applyTo = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
$categoryIds = ($applyTo === false) ? [] : $searchContainerData[... | [
"private",
"function",
"getCategoryIdsLimitation",
"(",
"$",
"entity",
")",
"{",
"$",
"searchContainerData",
"=",
"$",
"entity",
"->",
"getData",
"(",
"'catalog_view_container'",
")",
";",
"$",
"applyTo",
"=",
"is_array",
"(",
"$",
"searchContainerData",
")",
"?... | Retrieve category ids limitation for the current optimizer, if any.
@param OptimizerInterface $entity The optimizer being saved
@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/SaveHandler.php#L73-L80 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/SaveHandler.php | SaveHandler.getQueryIdsLimitation | private function getQueryIdsLimitation($entity)
{
$searchContainerData = $entity->getData('quick_search_container');
$applyTo = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
$queryIds = [];
if (($applyTo !== false) && (isset($searchCon... | php | private function getQueryIdsLimitation($entity)
{
$searchContainerData = $entity->getData('quick_search_container');
$applyTo = is_array($searchContainerData) ? ((bool) $searchContainerData['apply_to'] ?? false) : false;
$queryIds = [];
if (($applyTo !== false) && (isset($searchCon... | [
"private",
"function",
"getQueryIdsLimitation",
"(",
"$",
"entity",
")",
"{",
"$",
"searchContainerData",
"=",
"$",
"entity",
"->",
"getData",
"(",
"'quick_search_container'",
")",
";",
"$",
"applyTo",
"=",
"is_array",
"(",
"$",
"searchContainerData",
")",
"?",
... | Retrieve query ids limitation for the current optimizer, if any.
@param OptimizerInterface $entity The optimizer being saved
@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/SaveHandler.php#L89-L109 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Term.php | Term.buildQuery | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_TERM) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'value' => $query->getValue(),
... | php | public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_TERM) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->getType()}");
}
$searchQueryParams = [
'value' => $query->getValue(),
... | [
"public",
"function",
"buildQuery",
"(",
"QueryInterface",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"!==",
"QueryInterface",
"::",
"TYPE_TERM",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query builder... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Query/Builder/Term.php#L32-L50 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getNestedFieldName | public function getNestedFieldName()
{
$nestedFieldName = null;
if ($this->isNested()) {
$nestedPrefix = $this->getNestedPath() . '.';
$nestedFieldName = str_replace($nestedPrefix, '', $this->getName());
}
return $nestedFieldName;
} | php | public function getNestedFieldName()
{
$nestedFieldName = null;
if ($this->isNested()) {
$nestedPrefix = $this->getNestedPath() . '.';
$nestedFieldName = str_replace($nestedPrefix, '', $this->getName());
}
return $nestedFieldName;
} | [
"public",
"function",
"getNestedFieldName",
"(",
")",
"{",
"$",
"nestedFieldName",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"isNested",
"(",
")",
")",
"{",
"$",
"nestedPrefix",
"=",
"$",
"this",
"->",
"getNestedPath",
"(",
")",
".",
"'.'",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L164-L174 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getMappingPropertyConfig | public function getMappingPropertyConfig()
{
$property = $this->getPropertyConfig();
if ($this->getType() == self::FIELD_TYPE_TEXT) {
$analyzers = $this->getFieldAnalyzers();
$property = $this->getPropertyConfig(current($analyzers));
if (count($analyzers) > 1) {... | php | public function getMappingPropertyConfig()
{
$property = $this->getPropertyConfig();
if ($this->getType() == self::FIELD_TYPE_TEXT) {
$analyzers = $this->getFieldAnalyzers();
$property = $this->getPropertyConfig(current($analyzers));
if (count($analyzers) > 1) {... | [
"public",
"function",
"getMappingPropertyConfig",
"(",
")",
"{",
"$",
"property",
"=",
"$",
"this",
"->",
"getPropertyConfig",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"==",
"self",
"::",
"FIELD_TYPE_TEXT",
")",
"{",
"$",
"analyz... | {@inheritdoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L179-L193 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getMappingProperty | public function getMappingProperty($analyzer = self::ANALYZER_UNTOUCHED)
{
$fieldName = $this->getName();
$propertyName = $fieldName;
$property = $this->getMappingPropertyConfig();
$isDefaultAnalyzer = $analyzer == $this->getDefaultSearchAnalyzer();
if (isset($propert... | php | public function getMappingProperty($analyzer = self::ANALYZER_UNTOUCHED)
{
$fieldName = $this->getName();
$propertyName = $fieldName;
$property = $this->getMappingPropertyConfig();
$isDefaultAnalyzer = $analyzer == $this->getDefaultSearchAnalyzer();
if (isset($propert... | [
"public",
"function",
"getMappingProperty",
"(",
"$",
"analyzer",
"=",
"self",
"::",
"ANALYZER_UNTOUCHED",
")",
"{",
"$",
"fieldName",
"=",
"$",
"this",
"->",
"getName",
"(",
")",
";",
"$",
"propertyName",
"=",
"$",
"fieldName",
";",
"$",
"property",
"=",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L198-L219 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.mergeConfig | public function mergeConfig(array $config = [])
{
$config = array_merge($this->config, $config);
return new static($this->name, $this->type, $this->nestedPath, $config);
} | php | public function mergeConfig(array $config = [])
{
$config = array_merge($this->config, $config);
return new static($this->name, $this->type, $this->nestedPath, $config);
} | [
"public",
"function",
"mergeConfig",
"(",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"config",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"config",
",",
"$",
"config",
")",
";",
"return",
"new",
"static",
"(",
"$",
"this",
"->",
"name",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L232-L237 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getSortMissing | public function getSortMissing($direction = SortOrderInterface::SORT_ASC)
{
// @codingStandardsIgnoreStart
$missing = $direction === SortOrderInterface::SORT_ASC ? SortOrderInterface::MISSING_LAST : SortOrderInterface::MISSING_FIRST;
// @codingStandardsIgnoreEnd
if ($direction === S... | php | public function getSortMissing($direction = SortOrderInterface::SORT_ASC)
{
// @codingStandardsIgnoreStart
$missing = $direction === SortOrderInterface::SORT_ASC ? SortOrderInterface::MISSING_LAST : SortOrderInterface::MISSING_FIRST;
// @codingStandardsIgnoreEnd
if ($direction === S... | [
"public",
"function",
"getSortMissing",
"(",
"$",
"direction",
"=",
"SortOrderInterface",
"::",
"SORT_ASC",
")",
"{",
"// @codingStandardsIgnoreStart",
"$",
"missing",
"=",
"$",
"direction",
"===",
"SortOrderInterface",
"::",
"SORT_ASC",
"?",
"SortOrderInterface",
"::... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L242-L255 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.checkAnalyzer | private function checkAnalyzer($property, $expectedAnalyzer)
{
$isAnalyzerCorrect = true;
if ($property['type'] == self::FIELD_TYPE_TEXT || $property['type'] == self::FIELD_TYPE_KEYWORD) {
$isAnalyzed = $expectedAnalyzer !== self::ANALYZER_UNTOUCHED;
if ($isAnalyzed && (!is... | php | private function checkAnalyzer($property, $expectedAnalyzer)
{
$isAnalyzerCorrect = true;
if ($property['type'] == self::FIELD_TYPE_TEXT || $property['type'] == self::FIELD_TYPE_KEYWORD) {
$isAnalyzed = $expectedAnalyzer !== self::ANALYZER_UNTOUCHED;
if ($isAnalyzed && (!is... | [
"private",
"function",
"checkAnalyzer",
"(",
"$",
"property",
",",
"$",
"expectedAnalyzer",
")",
"{",
"$",
"isAnalyzerCorrect",
"=",
"true",
";",
"if",
"(",
"$",
"property",
"[",
"'type'",
"]",
"==",
"self",
"::",
"FIELD_TYPE_TEXT",
"||",
"$",
"property",
... | Check if an ES property as the right analyzer.
@param array $property ES Property.
@param string $expectedAnalyzer Analyzer expected for the property.
@return boolean | [
"Check",
"if",
"an",
"ES",
"property",
"as",
"the",
"right",
"analyzer",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L273-L288 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getMultiFieldMappingPropertyConfig | private function getMultiFieldMappingPropertyConfig($analyzers)
{
// Setting the field type to "multi_field".
$property = [];
foreach ($analyzers as $analyzer) {
if ($analyzer == $this->getDefaultSearchAnalyzer()) {
$property = array_merge($property, $this->getPr... | php | private function getMultiFieldMappingPropertyConfig($analyzers)
{
// Setting the field type to "multi_field".
$property = [];
foreach ($analyzers as $analyzer) {
if ($analyzer == $this->getDefaultSearchAnalyzer()) {
$property = array_merge($property, $this->getPr... | [
"private",
"function",
"getMultiFieldMappingPropertyConfig",
"(",
"$",
"analyzers",
")",
"{",
"// Setting the field type to \"multi_field\".",
"$",
"property",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"analyzers",
"as",
"$",
"analyzer",
")",
"{",
"if",
"(",
"$",
... | Build a multi_field configuration from an analyzers list.
Standard analyzer is used as default subfield and should always be present.
If the standard analyzer is not present, no default subfield is defined.
@param array $analyzers List of analyzers used as subfields.
@SuppressWarnings(PHPMD.ElseExpression)
@return ... | [
"Build",
"a",
"multi_field",
"configuration",
"from",
"an",
"analyzers",
"list",
".",
"Standard",
"analyzer",
"is",
"used",
"as",
"default",
"subfield",
"and",
"should",
"always",
"be",
"present",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L302-L316 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getFieldAnalyzers | private function getFieldAnalyzers()
{
$analyzers = [];
if ($this->isSearchable() || $this->isUsedForSortBy()) {
// Default search analyzer.
$analyzers = [$this->getDefaultSearchAnalyzer()];
if ($this->isSearchable() && $this->getSearchWeight() > 1) {
... | php | private function getFieldAnalyzers()
{
$analyzers = [];
if ($this->isSearchable() || $this->isUsedForSortBy()) {
// Default search analyzer.
$analyzers = [$this->getDefaultSearchAnalyzer()];
if ($this->isSearchable() && $this->getSearchWeight() > 1) {
... | [
"private",
"function",
"getFieldAnalyzers",
"(",
")",
"{",
"$",
"analyzers",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"isSearchable",
"(",
")",
"||",
"$",
"this",
"->",
"isUsedForSortBy",
"(",
")",
")",
"{",
"// Default search analyzer.",
"$",
"... | Retrieve analyzers used with the current field depending of the field configuration.
@return array | [
"Retrieve",
"analyzers",
"used",
"with",
"the",
"current",
"field",
"depending",
"of",
"the",
"field",
"configuration",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L323-L347 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Index/Mapping/Field.php | Field.getPropertyConfig | private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED)
{
$fieldMapping = ['type' => $this->getType()];
if ($this->getType() == self::FIELD_TYPE_TEXT && $analyzer == self::ANALYZER_UNTOUCHED) {
$fieldMapping['type'] = self::FIELD_TYPE_KEYWORD;
} elseif ($this->... | php | private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED)
{
$fieldMapping = ['type' => $this->getType()];
if ($this->getType() == self::FIELD_TYPE_TEXT && $analyzer == self::ANALYZER_UNTOUCHED) {
$fieldMapping['type'] = self::FIELD_TYPE_KEYWORD;
} elseif ($this->... | [
"private",
"function",
"getPropertyConfig",
"(",
"$",
"analyzer",
"=",
"self",
"::",
"ANALYZER_UNTOUCHED",
")",
"{",
"$",
"fieldMapping",
"=",
"[",
"'type'",
"=>",
"$",
"this",
"->",
"getType",
"(",
")",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"getType",... | Build the property config from the field type and an optional
analyzer (used for string and detected through getAnalyzers).
@param string|null $analyzer Used analyzer.
@return array | [
"Build",
"the",
"property",
"config",
"from",
"the",
"field",
"type",
"and",
"an",
"optional",
"analyzer",
"(",
"used",
"for",
"string",
"and",
"detected",
"through",
"getAnalyzers",
")",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Index/Mapping/Field.php#L357-L373 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Request/Aggregation/Builder/Term.php | Term.buildBucket | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_TERM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggregation = ['terms' => ['field' => $bucket->getField(), 's... | php | public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_TERM) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
$aggregation = ['terms' => ['field' => $bucket->getField(), 's... | [
"public",
"function",
"buildBucket",
"(",
"BucketInterface",
"$",
"bucket",
")",
"{",
"if",
"(",
"$",
"bucket",
"->",
"getType",
"(",
")",
"!==",
"BucketInterface",
"::",
"TYPE_TERM",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"\"Query bu... | 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/Term.php#L37-L57 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/RequestBuilder.php | RequestBuilder.getRequest | public function getRequest(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$storeId = $this->getCurrentStoreId();
$containerName = $searchCriteria->getRequestName();
$containerConfiguration = $this->getSearchContainerConfiguration($storeId, $containerName);
... | php | public function getRequest(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$storeId = $this->getCurrentStoreId();
$containerName = $searchCriteria->getRequestName();
$containerConfiguration = $this->getSearchContainerConfiguration($storeId, $containerName);
... | [
"public",
"function",
"getRequest",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Api",
"\\",
"Search",
"\\",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"getCurrentStoreId",
"(",
")",
";",
"$",
"cont... | Build a search request from a search criteria.
@param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria Search criteria.
@return \Smile\ElasticsuiteCore\Search\RequestInterface | [
"Build",
"a",
"search",
"request",
"from",
"a",
"search",
"criteria",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/RequestBuilder.php#L96-L115 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/RequestBuilder.php | RequestBuilder.updateSearchContext | private function updateSearchContext($storeId, $queryText)
{
$this->searchContext->setStoreId($storeId);
$query = $this->queryFactory->create();
$query->setStoreId($storeId);
$query->loadByQueryText($queryText);
if ($query->getId()) {
$this->searchContext->setCur... | php | private function updateSearchContext($storeId, $queryText)
{
$this->searchContext->setStoreId($storeId);
$query = $this->queryFactory->create();
$query->setStoreId($storeId);
$query->loadByQueryText($queryText);
if ($query->getId()) {
$this->searchContext->setCur... | [
"private",
"function",
"updateSearchContext",
"(",
"$",
"storeId",
",",
"$",
"queryText",
")",
"{",
"$",
"this",
"->",
"searchContext",
"->",
"setStoreId",
"(",
"$",
"storeId",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"queryFactory",
"->",
"create",... | Update the search context using current store id and query text.
@param integer $storeId Store id.
@param string $queryText Fulltext query text.
@return void | [
"Update",
"the",
"search",
"context",
"using",
"current",
"store",
"id",
"and",
"query",
"text",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/RequestBuilder.php#L125-L135 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/RequestBuilder.php | RequestBuilder.getCurrentStoreId | private function getCurrentStoreId()
{
$storeId = $this->storeManager->getStore()->getId();
if ($storeId == 0) {
$storeId = $this->storeManager->getDefaultStoreView()->getId();
}
return $storeId;
} | php | private function getCurrentStoreId()
{
$storeId = $this->storeManager->getStore()->getId();
if ($storeId == 0) {
$storeId = $this->storeManager->getDefaultStoreView()->getId();
}
return $storeId;
} | [
"private",
"function",
"getCurrentStoreId",
"(",
")",
"{",
"$",
"storeId",
"=",
"$",
"this",
"->",
"storeManager",
"->",
"getStore",
"(",
")",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"storeId",
"==",
"0",
")",
"{",
"$",
"storeId",
"=",
"$",
"... | Return current store id.
@return integer | [
"Return",
"current",
"store",
"id",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/RequestBuilder.php#L142-L151 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Model/Search/RequestBuilder.php | RequestBuilder.getFulltextFilter | private function getFulltextFilter(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$queryText = null;
foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
foreach ($filterGroup->getFilters() as $filter) {
if ($filter->getField() == "sea... | php | private function getFulltextFilter(\Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria)
{
$queryText = null;
foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
foreach ($filterGroup->getFilters() as $filter) {
if ($filter->getField() == "sea... | [
"private",
"function",
"getFulltextFilter",
"(",
"\\",
"Magento",
"\\",
"Framework",
"\\",
"Api",
"\\",
"Search",
"\\",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"$",
"queryText",
"=",
"null",
";",
"foreach",
"(",
"$",
"searchCriteria",
"->",
... | Extract fulltext search query from search criteria.
@param \Magento\Framework\Api\Search\SearchCriteriaInterface $searchCriteria Search criteria.
@return NULL|string | [
"Extract",
"fulltext",
"search",
"query",
"from",
"search",
"criteria",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Model/Search/RequestBuilder.php#L160-L173 |
Smile-SA/elasticsuite | src/module-elasticsuite-catalog/Model/Layer/FilterList.php | FilterList.getAttributeFilterClass | protected function getAttributeFilterClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$filterClassName = parent::getAttributeFilterClass($attribute);
if ($attribute->getBackendType() == 'varchar' && $attribute->getFrontendClass() == 'validate-number') {
$filterClas... | php | protected function getAttributeFilterClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$filterClassName = parent::getAttributeFilterClass($attribute);
if ($attribute->getBackendType() == 'varchar' && $attribute->getFrontendClass() == 'validate-number') {
$filterClas... | [
"protected",
"function",
"getAttributeFilterClass",
"(",
"\\",
"Magento",
"\\",
"Catalog",
"\\",
"Model",
"\\",
"ResourceModel",
"\\",
"Eav",
"\\",
"Attribute",
"$",
"attribute",
")",
"{",
"$",
"filterClassName",
"=",
"parent",
"::",
"getAttributeFilterClass",
"("... | {@inheritDoc} | [
"{"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-catalog/Model/Layer/FilterList.php#L34-L49 |
Smile-SA/elasticsuite | src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/DocumentFactory.php | DocumentFactory.create | public function create($rawDocument)
{
/** @var \Magento\Framework\Search\DocumentField[] $fields */
$entityIdFieldName = $this->entityMetadata->getEntityId();
$rawDocument[Document::ID] = $rawDocument[$entityIdFieldName];
return $this->objectManager->create($this->instanceName, [... | php | public function create($rawDocument)
{
/** @var \Magento\Framework\Search\DocumentField[] $fields */
$entityIdFieldName = $this->entityMetadata->getEntityId();
$rawDocument[Document::ID] = $rawDocument[$entityIdFieldName];
return $this->objectManager->create($this->instanceName, [... | [
"public",
"function",
"create",
"(",
"$",
"rawDocument",
")",
"{",
"/** @var \\Magento\\Framework\\Search\\DocumentField[] $fields */",
"$",
"entityIdFieldName",
"=",
"$",
"this",
"->",
"entityMetadata",
"->",
"getEntityId",
"(",
")",
";",
"$",
"rawDocument",
"[",
"Do... | Create search dcument instance from a ES hit.
@param array $rawDocument ES raw hit.
@return Document | [
"Create",
"search",
"dcument",
"instance",
"from",
"a",
"ES",
"hit",
"."
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/DocumentFactory.php#L64-L73 |
Smile-SA/elasticsuite | src/module-elasticsuite-admin-notification/Model/Feed.php | Feed.getFeedUrl | public function getFeedUrl()
{
if ($this->_feedUrl === null) {
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
$this->_feedUrl = $httpPath . self::ELASTICSUITE_FEED_URL;
}
return $this->_feedUrl;
} | php | public function getFeedUrl()
{
if ($this->_feedUrl === null) {
$httpPath = $this->_backendConfig->isSetFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://';
$this->_feedUrl = $httpPath . self::ELASTICSUITE_FEED_URL;
}
return $this->_feedUrl;
} | [
"public",
"function",
"getFeedUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_feedUrl",
"===",
"null",
")",
"{",
"$",
"httpPath",
"=",
"$",
"this",
"->",
"_backendConfig",
"->",
"isSetFlag",
"(",
"self",
"::",
"XML_USE_HTTPS_PATH",
")",
"?",
"'https... | Retrieve feed url
@return string | [
"Retrieve",
"feed",
"url"
] | train | https://github.com/Smile-SA/elasticsuite/blob/0199ac1383c8db3b996ae3a0963e94edadaf0880/src/module-elasticsuite-admin-notification/Model/Feed.php#L40-L48 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.