|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the Spryker Commerce OS. |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
declare(strict_types = 1); |
|
9
|
|
|
|
|
10
|
|
|
namespace Pyz\Client\Search; |
|
11
|
|
|
|
|
12
|
|
|
use Spryker\Client\Catalog\Plugin\Config\CatalogSearchConfigBuilder; |
|
13
|
|
|
use Spryker\Client\Kernel\Container; |
|
14
|
|
|
use Spryker\Client\MerchantProductOfferSearch\Plugin\Search\MerchantNameSearchConfigExpanderPlugin; |
|
15
|
|
|
use Spryker\Client\MerchantProductSearch\Plugin\Search\MerchantProductMerchantNameSearchConfigExpanderPlugin; |
|
16
|
|
|
use Spryker\Client\ProductSearchConfigStorage\Plugin\Config\ProductSearchConfigExpanderPlugin; |
|
17
|
|
|
use Spryker\Client\Search\Dependency\Plugin\SearchConfigBuilderInterface; |
|
18
|
|
|
use Spryker\Client\Search\SearchDependencyProvider as SprykerSearchDependencyProvider; |
|
19
|
|
|
use Spryker\Client\SearchElasticsearch\Plugin\ElasticsearchSearchAdapterPlugin; |
|
20
|
|
|
use Spryker\Client\SearchElasticsearch\Plugin\ElasticsearchSearchContextExpanderPlugin; |
|
21
|
|
|
use Spryker\Client\SearchHttp\Plugin\Search\SearchHttpSearchAdapterPlugin; |
|
22
|
|
|
use Spryker\Client\SearchHttp\Plugin\Search\SearchHttpSearchContextExpanderPlugin; |
|
23
|
|
|
|
|
24
|
|
|
class SearchDependencyProvider extends SprykerSearchDependencyProvider |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* @param \Spryker\Client\Kernel\Container $container |
|
28
|
|
|
* |
|
29
|
|
|
* @return \Spryker\Client\Search\Dependency\Plugin\SearchConfigBuilderInterface |
|
30
|
|
|
*/ |
|
31
|
|
|
protected function createSearchConfigBuilderPlugin(Container $container): SearchConfigBuilderInterface // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter |
|
32
|
|
|
{ |
|
33
|
|
|
return new CatalogSearchConfigBuilder(); |
|
|
|
|
|
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @param \Spryker\Client\Kernel\Container $container |
|
38
|
|
|
* |
|
39
|
|
|
* @return array<\Spryker\Client\SearchExtension\Dependency\Plugin\SearchConfigExpanderPluginInterface> |
|
40
|
|
|
*/ |
|
41
|
|
|
protected function createSearchConfigExpanderPlugins(Container $container): array |
|
42
|
|
|
{ |
|
43
|
|
|
$searchConfigExpanderPlugins = parent::createSearchConfigExpanderPlugins($container); |
|
44
|
|
|
|
|
45
|
|
|
$searchConfigExpanderPlugins[] = new ProductSearchConfigExpanderPlugin(); |
|
46
|
|
|
$searchConfigExpanderPlugins[] = new MerchantNameSearchConfigExpanderPlugin(); |
|
47
|
|
|
$searchConfigExpanderPlugins[] = new MerchantProductMerchantNameSearchConfigExpanderPlugin(); |
|
48
|
|
|
|
|
49
|
|
|
return $searchConfigExpanderPlugins; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @return array<\Spryker\Client\SearchExtension\Dependency\Plugin\SearchAdapterPluginInterface> |
|
54
|
|
|
*/ |
|
55
|
|
|
protected function getClientAdapterPlugins(): array |
|
56
|
|
|
{ |
|
57
|
|
|
return [ |
|
58
|
|
|
new SearchHttpSearchAdapterPlugin(), |
|
59
|
|
|
new ElasticsearchSearchAdapterPlugin(), |
|
60
|
|
|
]; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @return array<\Spryker\Client\SearchExtension\Dependency\Plugin\SearchContextExpanderPluginInterface> |
|
65
|
|
|
*/ |
|
66
|
|
|
protected function getSearchContextExpanderPlugins(): array |
|
67
|
|
|
{ |
|
68
|
|
|
return [ |
|
69
|
|
|
new SearchHttpSearchContextExpanderPlugin(), |
|
70
|
|
|
new ElasticsearchSearchContextExpanderPlugin(), |
|
71
|
|
|
]; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|