From f32f4da1a4aaffdf97373bed9836527fe7a9b91f Mon Sep 17 00:00:00 2001
From: Anton Ohorodnyk <aohorodnyk@ebay.com>
Date: Tue, 20 Oct 2015 16:33:22 +0300
Subject: [PATCH] MAGETWO-44118: Doesn't found bundle product

---
 .../Adapter/Mysql/Filter/Preprocessor.php      | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
index 98aa6bb7e71..c43a3623fa6 100644
--- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
+++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php
@@ -133,25 +133,15 @@ class Preprocessor implements PreprocessorInterface
                 $value
             );
         } else {
-            $table = $attribute->getBackendTable();
+            $table = $this->resource->getTableName('catalog_product_index_eav_decimal');
             $select = $this->connection->select();
-            $ifNullCondition = $this->connection->getIfNullSql('current_store.value', 'main_table.value');
 
             $currentStoreId = $this->scopeResolver->getScope()->getId();
 
             $select->from(['main_table' => $table], 'entity_id')
-                ->joinLeft(
-                    ['current_store' => $table],
-                    'current_store.attribute_id = main_table.attribute_id AND current_store.store_id = '
-                    . $currentStoreId,
-                    null
-                )
-                ->columns([$filter->getField() => $ifNullCondition])
-                ->where(
-                    'main_table.attribute_id = ?',
-                    $attribute->getAttributeId()
-                )
-                ->where('main_table.store_id = ?', Store::DEFAULT_STORE_ID)
+                ->columns([$filter->getField() => 'main_table.value'])
+                ->where('main_table.attribute_id = ?', $attribute->getAttributeId())
+                ->where('main_table.store_id = ?', $currentStoreId)
                 ->having($query);
 
             $resultQuery = 'search_index.entity_id IN (
-- 
GitLab