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 67898d021d7..a3cb8dfd8f2 100644 --- a/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php +++ b/vendor/magento/module-elasticsearch/Model/Adapter/BatchDataMapper/ProductDataMapper.php @@ -208,7 +208,7 @@ class ProductDataMapper implements BatchDataMapperInterface $productAttributes = []; $retrievedValue = $this->retrieveFieldValue($attributeValues); - if ($retrievedValue) { + if ($retrievedValue !== null) { $productAttributes[$attribute->getAttributeCode()] = $retrievedValue; if ($attribute->getIsSearchable()) { @@ -340,8 +340,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 d88c7e53d81..5c8834303c2 100644 --- a/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php +++ b/vendor/magento/module-elasticsearch/SearchAdapter/Filter/Builder/Term.php @@ -68,7 +68,7 @@ class Term implements FilterInterface $fieldName .= '.' . $suffix; } - if ($filter->getValue()) { + if ($filter->getValue() !== false) { $operator = is_array($filter->getValue()) ? 'terms' : 'term'; $filterQuery []= [ $operator => [