Smart Search integration - incompatible "Optimize Index"

  • Posts: 86
  • Thank you received: 5
10 months 1 week ago #352597

-- HikaShop version -- : 4.7.3 starter
-- Joomla version -- : 4.3.2
-- PHP version -- : 8.1
-- Error-message(debug-mod must be tuned on) -- : Unknown column 'id' in 'field list'

Hi, after having indexed HikasShop products with Smart Search, if the "Optimize" command is given in Smart Search - Maintenance, that fails with

Unknown column 'id' in 'field list'
After some debugging, this is because there is this query
SELECT CONCAT('index.php?option=com_hikashop&ctrl=product&task=show&cid=&name=&Itemid=<menu_id>', id)
FROM `#__hikashop_product`)

but there is no 'id' column in #__hikashop_product table, just a 'product_id'.
Disabling smart search hikashop plugin, of course the problem disappears since hikashop products are not indexed anymore.
I don't know if it's a Joomla bug or a Hikashop one.
Thanks

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
10 months 1 week ago #352600

Hi,

Well, the bug is kind of shared. Joomla added this optimize function to the Smart Search. But there is no information on it in the developer doc anywhere (or anywhere I could find). Also, the bug happens because Joomla supposes that any table which is indexed uses the column name "id" for the id of the elements indexed, and that's not the case in HikaShop since we're using "product_id" instead.
Fortunately, I was able to find an event which we'll implement in the next version of HikaShop to allow us to override this mechanism for the the smart search plugin in HikaShop.
Finally, note that the optimization system is not that great. What it does is that it deletes the index data for elements that have been deleted. But the smart search plugin we developed already delete the index data when a product is deleted.

The following user(s) said Thank You: Giuse

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum