diff -Nuar a/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php b/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php index cd2529a8fd7..f5d41983187 100644 --- a/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php +++ b/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php @@ -572,11 +572,11 @@ class DataProvider foreach ($indexData as $entityId => $attributeData) { foreach ($attributeData as $attributeId => $attributeValues) { $value = $this->getAttributeValue($attributeId, $attributeValues, $storeId); - if (!empty($value)) { + if ($value !== null && $value !== false && $value !== '') { if (!isset($index[$attributeId])) { $index[$attributeId] = []; } - $index[$attributeId][$entityId] = $value; + $index[$attributeId][$entityId] = $value; } } } diff -Nuar a/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php b/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php index 270ca37e2d4..e9f2159b0c0 100644 --- a/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php +++ b/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php @@ -195,7 +195,7 @@ class ProductDataMapper implements BatchDataMapperInterface $productAttributes = []; $retrievedValue = $this->retrieveFieldValue($attributeValues); - if ($retrievedValue) { + if ($retrievedValue !== null) { $productAttributes[$attribute->getAttributeCode()] = $retrievedValue; if ($attribute->getIsSearchable()) { @@ -320,8 +320,8 @@ class ProductDataMapper implements BatchDataMapperInterface */ private function retrieveFieldValue(array $values) { - $values = \array_filter(\array_unique($values)); + $values = array_unique($values); - return count($values) === 1 ? \array_shift($values) : \array_values($values); + return count($values) === 1 ? array_shift($values) : array_values($values); } } diff -Nuar a/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php b/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php index ed8cd049d29..fbe61c110b6 100644 --- a/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php +++ b/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php @@ -31,7 +31,7 @@ class Term implements FilterInterface public function buildFilter(RequestFilterInterface $filter) { $filterQuery = []; - if ($filter->getValue()) { + if ($filter->getValue() !== false) { $operator = is_array($filter->getValue()) ? 'terms' : 'term'; $filterQuery []= [ $operator => [