cancel
Showing results for 
Search instead for 
Did you mean: 

Temporary tables not being made on Search

Temporary tables not being made on Search

Hi,

I need help fixing the following error:

3 exception(s):
Exception #0 (Magento\Framework\DB\Adapter\TableNotFoundException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'malanicob2_magento.search_tmp_64f1b20b2df895_82022950' doesn't exist, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.customer_group_id = '1' AND price_index.website_id = '1'
 INNER JOIN `catalog_category_product_index_store3` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=3 AND cat_index.visibility IN(3, 4) AND cat_index.category_id=2
 INNER JOIN `search_tmp_64f1b20b2df895_82022950` AS `search_result` ON e.entity_id = search_result.entity_id
Exception #1 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'malanicob2_magento.search_tmp_64f1b20b2df895_82022950' doesn't exist, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.customer_group_id = '1' AND price_index.website_id = '1'
 INNER JOIN `catalog_category_product_index_store3` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=3 AND cat_index.visibility IN(3, 4) AND cat_index.category_id=2
 INNER JOIN `search_tmp_64f1b20b2df895_82022950` AS `search_result` ON e.entity_id = search_result.entity_id
Exception #2 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'malanicob2_magento.search_tmp_64f1b20b2df895_82022950' doesn't exist

 Apologies for the length.


It seems that the temporary table with search results isn't being made.
I get this error when trying to execute a search through the search bar.
I don't use any plugins/extensions that have to do with Search, and I am using a theme, although that worked fine before, and I haven't changed any code related to this, especially not the database. 
Magento queries through the REST API work fine, just not the search bar itself.

Any ideas on how to fix this? Maybe edit the file where the query is made? Or reroll a backup of the database?

I have seen the issue before on the forum, but never with a temporary table, so the solutions offered were "make the table with this SQL query", but that won't work on a temporary table.

 

Thanks in advance!