Smart Search Index Issues when using Smart Search - HikaShop Products

  • Posts: 303
  • Thank you received: 18
1 year 7 months ago #351199

-- HikaShop version -- : 4.7.2
-- Joomla version -- : 4.3.0
-- PHP version -- : 8.1

When I run the indexer with "Smart Search - HikaShop Products" turned on, I receive a JSON error that stops the indexing. Some products are indexed, but not all (all other joomla content isn't indexed either since it is indexed AFTER hikashop content):

An Error Has Occurred
The following message was returned by the server:
A parse error has occurred while processing the following JSON data:
Unexpected token '<', "<br /> <b>"... is not valid JSON



If I disable this plugin and run the indexer, no errors and all other Joomla content is indexed properly:



From the JSON parse error, it would seem like something isn't being sanitized properly. I have tried changing the columns that should be indexed and toggling the index by category or not. No luck.

Let me know if you need any additional information or backend access.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 7 months ago #351204

Hi,

What you're describing indeed seems to mean that you've selected some columns containing invalid text.
The error is not complete. Could you please look in the PHP error log of your hosting for the error message ? You should find the rest of the error, which should point at the file and line number where the problem is happening. That should help us move forward. Also, we'll probably need a backend and a FTP access in order to investigate.

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

  • Posts: 303
  • Thank you received: 18
1 year 6 months ago #351214

I think I located at least most of the issue. From the php error logs, I saw many deprecation warnings for Joomla Works "All Videos" plugin. My only guess that there is some product on our site that still has shortcode for AllVideos plugin.

mod_fcgid: stderr: PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in ###/plugins/content/jw_allvideos/jw_allvideos.php on line 81, referer: ###/administrator/index.php?option=com_finder&view=indexer&tmpl=component
mod_fcgid: stderr: PHP Deprecated:  str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in ###/plugins/content/jw_allvideos/jw_allvideos.php on line 157, referer: ###/administrator/index.php?option=com_finder&view=indexer&tmpl=component

I patched that plugin by checking for nulls, and the errors are gone and indexing is running to completion.

I have 2 somewhat related questions:

1. is it normal for products with no titles to be indexed? I'm not even clear where these are coming from as the links they point to are dead.
2. are categories indexed with this smart search plugin?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 6 months ago #351215

Hi,

1. The plugin doesn't check that the name of the product is filled when the indexing requests the list of products to be indexed. So it's totally possible that products without names are indexed.
Could you provide the link of one of these products ? It should contain the product_id or the product_alias in the URL. From there, it should be possible to search for it in the backend products listing.

2. Categories are not indexed.

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

  • Posts: 303
  • Thank you received: 18
1 year 6 months ago #351241

I checked for the product IDs listed in the index, but for the ones without a title, most do not have a product entry (checked trashed as well):



However, after spot checking some of the links, some of them point to the raw product page (no parent category). For the others that don't exist, I checked through some really old backups, and these correspond to products that no longer exist (deleted from the backend). I guess it might be possible if there's some issue with the DB still retaining these old, deleted products?

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 6 months ago #351243

Hi,

Indeed. Products indexed and deleted before installing HikaShop HikaShop 4.4.1 or newer would be left in the index.
Before that, products being deleted wouldn't trigger the smart search system.
So you can just delete these old entries.

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

  • Posts: 303
  • Thank you received: 18
1 year 6 months ago #351252

Index in this context would be indexing on Hikashop database side? I have cleared the smart search index multiple times and they still show up.

It seems like they might be rogue products that were deleted but still show in the products DB table.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 6 months ago #351254

Hi,

If the products are deleted, they can't be indexed.
If they are reindexed, it means they are still there and not deleted.
Please provide a backend access and we can look at the situation.
www.hikashop.com/support/contact-us.html

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

  • Posts: 303
  • Thank you received: 18
1 year 6 months ago #351275

Ah, I see why I could not find them on the backend. After querying the DB for the product IDs in question, I figured out that they are variants, which I typically don't assign product names to (uses the main product for the name and images).

I guess I will either add names to these variants or just delete those index entries.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 6 months ago #351282

Hi,

Ok. That makes sense.
On our end, I've made a patch in HikaShop to properly fill the name parameter in the URL even when indexing variants.
That way, it should mean it can still index variants (if you set different descriptions for each for example), while generating a valid link.

The following user(s) said Thank You: mojooutdoors-holden

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

  • Posts: 2
  • Thank you received: 0
1 year 4 months ago #353329

Hi,

I have same issue, is

very stressing...if have any suggestion to fix it will be appreciated.

Fien

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 4 months ago #353331

Hi,

The fix is already in HikaShop. So if you have an old version of HikaShop, update it.
Then, click on the "index" button of the Smart Search component in the backend to reindex everything and it should be good.

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

  • Posts: 2
  • Thank you received: 0
1 year 4 months ago #353344

Hi Nicolas,

Thank you for your updated, well.. currently my website has Chinese & Japanese version, so that why I have updated my Hikashop to be paid version to have smart search services indexing my all-product category, Thanks again & lets looks forward the next updated in September.

regards,
Fien

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

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355307

With the push for smart search (finder) as default in J4, are there plans of deprecating the existing hikashop search plugins?

Odd behavior I found:

  1. If I unpublish all of the pkg_search plugins and package (i.e., smart search only), i don't see the hikashop content indexed.
  2. If I unpublish the search plugin for hikashop categories, i don't see the category entries in smart search.
  3. links displayed in search results are no longer canonical links and are instead basic product links with no category attached.

Last edit: 1 year 1 month ago by mojooutdoors-holden.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 1 month ago #355325

Hi,

1. and 2. The plugins of the group "search" are not related to the smart search. Disabling them won't change anything for the indexing of the smart search. Please double check.
Note that categories are not indexed by the smart search. Only the products are indexed.
And the smart search system won't take into account the search results of the plugins of the group "search".
It will only take into account the data indexed thanks to the plugins of the group "finder".

3. That's indeed the case. Due to how the smart search works, the link to the product page needs to be provided by the finder plugin during the indexing in a non SEFed format. So we cannot provide the canonical URL at that point. I didn't find a way to change this.

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

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355357

It's a shame the canonical can't be used and that the categories are not indexed. The search results show products that appear to be in root category instead of their actual category.

Since the product_canonical can be set as an index in the hikashop smart search plugin, perhaps finder just needs an override to disolay this custom field if available instead of non-SEF url?

Also, I will try disabling the search type plugins again to see if hikashop is indexed properly.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 1 month ago #355361

Hi,

With a view override of the search results page of the smart search component, you could indeed have it use the canonical URL when available. It would require running a MySQL query to load up the data from the database.
Now, that's not something we can implement as a clean solution on our end. View overrides are supposed to be either:
- provided by the template
- made by the end user for his specific needs
Components are not supposed to create view overrides for other components.

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

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355370

Thanks for the explanation. Makes sense.

Last question. I understand categories themselves are not indexed, but there's a setting in the finder plugin for hikashop called "index products by category". I would think this would yield non-SEF product links with the category id appended to the URL. However, with that option enabled, i still only see the product SEF without category specified. Am i misunderstanding what that setting means?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 1 month ago #355441

Hi,

This option will allow you to display a filter dropdown on the categories in the smart search page on the frontend.
It has nothing to do with the URL of the search results.

The following user(s) said Thank You: mojooutdoors-holden

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

Time to create page: 0.147 seconds
Powered by Kunena Forum