Skip to content

Commit 0c441c4

Browse files
authored
Merge pull request #5375 from magento-trigger/elasticsearch_spike
- adding elasticsearch 7 support
2 parents c8304be + 3d2ca89 commit 0c441c4

File tree

64 files changed

+2568
-428
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2568
-428
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeOptionData.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,28 @@
101101
<entity name="ProductAttributeOptionTwoForExportImport" extends="productAttributeOption2" type="ProductAttributeOption">
102102
<data key="label">option2</data>
103103
</entity>
104+
<entity name="ProductAttributeOption10" type="ProductAttributeOption">
105+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
106+
<data key="label" unique="suffix">3.5</data>
107+
<data key="value" unique="suffix">3.5</data>
108+
<data key="is_default">false</data>
109+
<data key="sort_order">1</data>
110+
<requiredEntity type="StoreLabel">Option12Store1</requiredEntity>
111+
</entity>
112+
<entity name="ProductAttributeOption11" type="ProductAttributeOption">
113+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
114+
<data key="label" unique="suffix">10.12</data>
115+
<data key="value" unique="suffix">10.12</data>
116+
<data key="is_default">false</data>
117+
<data key="sort_order">2</data>
118+
<requiredEntity type="StoreLabel">Option13Store1</requiredEntity>
119+
</entity>
120+
<entity name="ProductAttributeOption12" type="ProductAttributeOption">
121+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
122+
<data key="label" unique="suffix">36</data>
123+
<data key="value" unique="suffix">36</data>
124+
<data key="is_default">false</data>
125+
<data key="sort_order">3</data>
126+
<requiredEntity type="StoreLabel">Option14Store1</requiredEntity>
127+
</entity>
104128
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/StoreLabelData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,16 @@
8080
<data key="store_id">1</data>
8181
<data key="label">Blue</data>
8282
</entity>
83+
<entity name="Option12Store1" type="StoreLabel">
84+
<data key="store_id">1</data>
85+
<data key="label">3.5</data>
86+
</entity>
87+
<entity name="Option13Store1" type="StoreLabel">
88+
<data key="store_id">1</data>
89+
<data key="label">10.12</data>
90+
</entity>
91+
<entity name="Option14Store1" type="StoreLabel">
92+
<data key="store_id">1</data>
93+
<data key="label">36</data>
94+
</entity>
8395
</entities>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductMultiselectAttributeSection">
12+
<element name="option" type="text" selector="//option[contains(@data-title,'{{value}}')]" parameterized="true"/>
13+
</section>
14+
</sections>

app/code/Magento/Elasticsearch/Block/Adminhtml/System/Config/Elasticsearch5/TestConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
/**
99
* Elasticsearch 5x test connection block
1010
* @codeCoverageIgnore
11+
* @deprecated because of EOL for Elasticsearch5
1112
*/
1213
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1314
{
1415
/**
15-
* {@inheritdoc}
16+
* @inheritdoc
1617
*/
1718
protected function _getFieldMapping()
1819
{

app/code/Magento/Elasticsearch/Block/Adminhtml/System/Config/TestConnection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
/**
99
* Elasticsearch test connection block
1010
* @codeCoverageIgnore
11+
* @deprecated because of EOL for Elasticsearch2
1112
*/
1213
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1314
{
1415
/**
15-
* {@inheritdoc}
16+
* @inheritdoc
1617
*/
1718
protected function _getFieldMapping()
1819
{

app/code/Magento/Elasticsearch/Elasticsearch5/Model/Client/Elasticsearch.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Elasticsearch client
13+
*
14+
* @deprecated the Elasticsearch 5 doesn't supported due to EOL
1315
*/
1416
class Elasticsearch implements ClientInterface
1517
{

app/code/Magento/Elasticsearch/Elasticsearch5/SearchAdapter/Aggregation/Interval.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct(
8787
}
8888

8989
/**
90-
* {@inheritdoc}
90+
* @inheritdoc
9191
*/
9292
public function load($limit, $offset = null, $lower = null, $upper = null)
9393
{
@@ -116,7 +116,7 @@ public function load($limit, $offset = null, $lower = null, $upper = null)
116116
}
117117

118118
/**
119-
* {@inheritdoc}
119+
* @inheritdoc
120120
*/
121121
public function loadPrevious($data, $index, $lower = null)
122122
{
@@ -141,11 +141,15 @@ public function loadPrevious($data, $index, $lower = null)
141141
return false;
142142
}
143143

144+
if (is_array($offset)) {
145+
$offset = $offset['value'];
146+
}
147+
144148
return $this->load($index - $offset + 1, $offset - 1, $lower);
145149
}
146150

147151
/**
148-
* {@inheritdoc}
152+
* @inheritdoc
149153
*/
150154
public function loadNext($data, $rightIndex, $upper = null)
151155
{
@@ -166,6 +170,10 @@ public function loadNext($data, $rightIndex, $upper = null)
166170
return false;
167171
}
168172

173+
if (is_array($offset)) {
174+
$offset = $offset['value'];
175+
}
176+
169177
$from = ['gte' => $data - self::DELTA];
170178
if ($upper !== null) {
171179
$to = ['lt' => $data - self::DELTA];

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/CategoryFieldsProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* Provide data mapping for categories fields
17+
*
18+
* @deprecated because of EOL for Elasticsearch2
1719
*/
1820
class CategoryFieldsProvider implements AdditionalFieldsProviderInterface
1921
{

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/DataMapperFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
use Magento\Elasticsearch\Model\Adapter\BatchDataMapperInterface;
1212

1313
/**
14-
* Data mapper factory
14+
* Data mapper factory uses to create appropriate mapper class
15+
*
16+
* @deprecated because of EOL for Elasticsearch2
1517
*/
1618
class DataMapperFactory
1719
{

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/DataMapperResolver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
/**
1414
* Map index data to search engine metadata
15+
*
16+
* @deprecated because of EOL for Elasticsearch2
1517
*/
1618
class DataMapperResolver implements BatchDataMapperInterface
1719
{
@@ -34,7 +36,7 @@ public function __construct(DataMapperFactory $dataMapperFactory)
3436
}
3537

3638
/**
37-
* {@inheritdoc}
39+
* @inheritdoc
3840
*/
3941
public function map(array $documentData, $storeId, array $context = [])
4042
{

0 commit comments

Comments
 (0)