Skip to main content

Duplicate Search Results in Finder.

More
5 years 7 months ago #329546 by joom_dev
-- 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.

More
5 years 7 months ago #329570 by nicolas
Hi,

Yes, the products are indexed for each category they are in.
Remove the lines:
Code:
->select('c.category_name AS category, c.category_alias as categoryalias, c.category_published AS cat_state, 1 AS cat_access')
Code:
$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:
Code:
->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.

More
5 years 7 months ago #329613 by joom_dev
Hi Nicolas,

Still seeing the duplicates after commenting this code.

Thanks,
Chetan

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

More
5 years 7 months ago #329629 by nicolas
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.

More
5 years 7 months ago #329648 by joom_dev
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.

More
5 years 7 months ago - 5 years 7 months ago #329653 by nicolas
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.
Last edit: 5 years 7 months ago by nicolas.

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

More
5 years 7 months ago #329728 by joom_dev
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.266 seconds
Powered by Kunena Forum