- Posts: 7
- Thank you received: 1
Duplicate Search Results in Finder.
5 years 7 months ago #329546
by joom_dev
Duplicate Search Results in Finder. was created 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
-- 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.
5 years 7 months ago #329570
by nicolas
Replied by nicolas on topic Duplicate Search Results in Finder.
Hi,
Yes, the products are indexed for each category they are in.
Remove the lines:
and:
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.
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);
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')
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.
5 years 7 months ago #329613
by joom_dev
Replied by joom_dev on topic Duplicate Search Results in Finder.
Hi Nicolas,
Still seeing the duplicates after commenting this code.
Thanks,
Chetan
Still seeing the duplicates after commenting this code.
Thanks,
Chetan
Please Log in or Create an account to join the conversation.
5 years 7 months ago #329629
by nicolas
Replied by nicolas on topic Duplicate Search Results in Finder.
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 ?
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.
5 years 7 months ago #329648
by joom_dev
Replied by joom_dev on topic Duplicate Search Results in Finder.
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
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.
5 years 7 months ago - 5 years 7 months ago #329653
by nicolas
Replied by nicolas on topic Duplicate Search Results in Finder.
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.
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.
5 years 7 months ago #329728
by joom_dev
Replied by joom_dev on topic Duplicate Search Results in Finder.
That worked nicolas.
Thank you,
Chetan
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.242 seconds