Skip to content

Commit 8f7ddd1

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-85699' into 2.2-develop-pr68
2 parents 10104f6 + 8ae9620 commit 8f7ddd1

File tree

2 files changed

+29
-2
lines changed
  • app/code/Magento/CatalogSearch/Model/ResourceModel
  • dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action

2 files changed

+29
-2
lines changed

app/code/Magento/CatalogSearch/Model/ResourceModel/Engine.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,19 @@ public function processAttributeValue($attribute, $value)
107107
&& in_array($attribute->getFrontendInput(), ['text', 'textarea'])
108108
) {
109109
$result = $value;
110-
} elseif ($this->isTermFilterableAttribute($attribute)) {
110+
} elseif ($this->isTermFilterableAttribute($attribute)
111+
|| ($attribute->getIsSearchable()
112+
&& in_array($attribute->getFrontendInput(), ['select', 'multiselect']))
113+
) {
111114
$result = '';
112115
}
113116

114117
return $result;
115118
}
116119

117120
/**
118-
* Prepare index array as a string glued by separator
121+
* Prepare index array as a string glued by separator.
122+
*
119123
* Support 2 level array gluing
120124
*
121125
* @param array $index

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ protected function setUp()
2929
}
3030

3131
/**
32+
* Testing fulltext index rebuild.
33+
*
3234
* @magentoDataFixture Magento/CatalogSearch/_files/products_for_index.php
3335
* @magentoDataFixture Magento/CatalogSearch/_files/product_configurable_not_available.php
3436
* @magentoDataFixture Magento/Framework/Search/_files/product_configurable.php
@@ -58,6 +60,8 @@ public function testGetIndexData()
5860
}
5961

6062
/**
63+
* Prepare and return expected index data.
64+
*
6165
* @return array
6266
*/
6367
private function getExpectedIndexData()
@@ -68,32 +72,49 @@ private function getExpectedIndexData()
6872
$nameId = $attributeRepository->get(ProductInterface::NAME)->getAttributeId();
6973
/** @see dev/tests/integration/testsuite/Magento/Framework/Search/_files/configurable_attribute.php */
7074
$configurableId = $attributeRepository->get('test_configurable')->getAttributeId();
75+
$statusId = $attributeRepository->get(ProductInterface::STATUS)->getAttributeId();
76+
$taxClassId = $attributeRepository
77+
->get(\Magento\Customer\Api\Data\GroupInterface::TAX_CLASS_ID)
78+
->getAttributeId();
79+
7180
return [
7281
'configurable' => [
7382
$skuId => 'configurable',
7483
$configurableId => 'Option 1 | Option 2',
7584
$nameId => 'Configurable Product | Configurable OptionOption 1 | Configurable OptionOption 2',
85+
$taxClassId => 'Taxable Goods | Taxable Goods | Taxable Goods',
86+
$statusId => 'Enabled | Enabled | Enabled',
7687
],
7788
'index_enabled' => [
7889
$skuId => 'index_enabled',
7990
$nameId => 'index enabled',
91+
$taxClassId => 'Taxable Goods',
92+
$statusId => 'Enabled',
8093
],
8194
'index_visible_search' => [
8295
$skuId => 'index_visible_search',
8396
$nameId => 'index visible search',
97+
$taxClassId => 'Taxable Goods',
98+
$statusId => 'Enabled',
8499
],
85100
'index_visible_category' => [
86101
$skuId => 'index_visible_category',
87102
$nameId => 'index visible category',
103+
$taxClassId => 'Taxable Goods',
104+
$statusId => 'Enabled',
88105
],
89106
'index_visible_both' => [
90107
$skuId => 'index_visible_both',
91108
$nameId => 'index visible both',
109+
$taxClassId => 'Taxable Goods',
110+
$statusId => 'Enabled',
92111
]
93112
];
94113
}
95114

96115
/**
116+
* Testing fulltext index rebuild with configurations.
117+
*
97118
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
98119
*/
99120
public function testRebuildStoreIndexConfigurable()
@@ -114,6 +135,8 @@ public function testRebuildStoreIndexConfigurable()
114135
}
115136

116137
/**
138+
* Get product Id by its SKU.
139+
*
117140
* @param string $sku
118141
* @return int
119142
*/

0 commit comments

Comments
 (0)