Not all HikaShop products appear in Joomla Smart Search results

  • Posts: 228
  • Thank you received: 6
  • Hikashop Business
10 hours 14 minutes ago #367834

-- HikaShop version -- : 6.0.0
-- Joomla version -- : 5.3.2‎
-- PHP version -- : 8.3.20

Dear HikaShop Team,

We're encountering an issue with HikaShop product indexing in Joomla Smart Search. Although our products are published and records for them exist in the #__finder_links table, they do not appear in the website's search results.

Indexing has been performed multiple times, including via Joomla CLI (joomla.php finder:index) and with various Smart Search module/component settings. Server resources are adequate.

Upon analyzing the #__finder_links table, we found that for these non-displaying products, the state field is set to 0, whereas for products that successfully appear in search, state is 1. Manually changing the state to 1 for a problematic product immediately makes it visible in Smart Search results.

Could you please explain why the "Finder - HikaShop" plugin sets state=0 for published products? What are the possible causes and solutions for this issue?

Additionally, we're interested in how we can further customize the display of search results for HikaShop products. Specifically, we'd like to know how to include information like the manufacturer's name or custom fields in the search output, to make the results more closely resemble a brief product card.

Thank you for your assistance.

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

  • Posts: 84077
  • Thank you received: 13627
  • MODERATOR
3 hours ago #367835

Hi,

The state field is set to 0 not only for unpublished products, but also :
- for published products with unpublished categories linked to them because a product linked to no published category should not be accessible
- for published products with their access level not set to "all" or if the access level setting doesn't have "public" checked (user group with the id 9) because you don't want a product to be searchable by crawlers if it is not accessible to the public
- for published products that have been trashed (when you delete a product while the "Activate product recovery" setting is turned on in the HikaShop configuration, it will go to the trash and you can either empty the trash or restore the product from it, but the product is not available on the frontend in that case)
- for published products with a stock of zero if you have turned off the "Display out of stock products" setting of the HikaShop configuration page.

These conditions are handled by the code in the function getStateColumn of the file plugins/finder/hikashop/hikashop.php

Regarding the solutions, I would say that, as far as I understand, it is normal that published products with any of these criteria are not available in the smart search results.

If you want to customize the results page, you'll have to add custom PHP code in a view override of the results view of the Smart Search component:
magazine.joomla.org/all-issues/march-202...search-results-pages
This will require a developer to work on it. It's not easy because the developer will first have to load the data of the product, process it, before he can display it in the search results page.

A simpler solution to all of this would be to actually not use the Smart Search, and instead use the filter system of HikaShop:
www.hikashop.com/support/documentation/1...-filter-listing.html
With a text filter, and the HikaShop Filter module, you can have a search mechanism similar to the Smart Search but without its inconvenients:
- The results will display as a normal HikaShop products listing by default, so no customization required
- The results are loaded dynamically, so there is no indexing
It's a bit fiddly to setup but so is Smart Search.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum