Duplicate Search Results in Finder.

  • Posts: 7
  • Thank you received: 1
3 years 9 months ago #329546

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.2

Hello,

It seems like any product that's in multiple categories will be listed multiple times in search results.

I know duplicate results can be disabled via finder in the backend but it seems redundant and time consuming to do it every time you run the index for multiple products.

Is there a fix for this?

Thanks,
Chetan

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 9 months ago #329570

Hi,

Yes, the products are indexed for each category they are in.
Remove the lines:

->select('c.category_name AS category, c.category_alias as categoryalias, c.category_published AS cat_state, 1 AS cat_access')
$case_when_item_alias = ' CASE WHEN a.product_alias != "" THEN a.product_alias ELSE a.product_name END as slug';
		$query->select($case_when_item_alias);
and:
->join('LEFT', '#__hikashop_product_category AS pc ON a.product_id = pc.product_id')
			->join('LEFT', '#__hikashop_category AS c ON pc.category_id = c.category_id')
from the file plugins/finder/hikashop/hikashop.php and it should prevent that.
Let us know how it goes. Ideally, we could have an option in the plugin to activate or deactivate that.

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

  • Posts: 7
  • Thank you received: 1
3 years 9 months ago #329613

Hi Nicolas,

Still seeing the duplicates after commenting this code.

Thanks,
Chetan

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 9 months ago #329629

Hi,

Well, this modification won't remove the results already indexed. This modification is to avoid the system from reindexing duplicates when the product are in several categories.
Can you confirm that you cleared the index before reindexing with the modification ?

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

  • Posts: 7
  • Thank you received: 1
3 years 9 months ago #329648

Hi Nicolas,

Silly me, I did not ran the index again, but when I did. I got some errors, So I went ahead and modified the SQL a bit and here is the final function for getlistQuery before that works and display the product only once.
gist.github.com/chetanmadaan/30b535d747b027855e21487dd5e121c3

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 9 months ago #329653

Hi,

I've made the option. Please install the plugin, check that the option is turned off, and it should work liek you need when reindexing the products.

Attachments:
Last edit: 3 years 9 months ago by nicolas.

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

  • Posts: 7
  • Thank you received: 1
3 years 9 months ago #329728

That worked nicolas.

Thank you,
Chetan

The following user(s) said Thank You: nicolas

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

Time to create page: 0.058 seconds
Powered by Kunena Forum