Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Sku isn't searchable for new products
- This topic has 7 replies, 2 voices, and was last updated 2 years, 6 months ago by
Ernest Marcinko.
-
AuthorPosts
-
December 5, 2023 at 2:18 pm #46301
Henrik Leth
ParticipantHi Ernest.
It’s the solution with the 4.5 million records 🙂
I have a problem with newly created products.
It’s possible to search for the product itself; but not the SKU.
The SKU is included in the index table; but it doesn’t seem to work.
What am I doing wrong ?
Best regards
Webshop-Partners ApS
Henrik LethDecember 6, 2023 at 1:10 pm #46307Ernest Marcinko
KeymasterHi,
Are the products with the SKU issue imported in any way or form, or perhaps the SKU is added in later programmatically/3rd party plugin somehow?
December 6, 2023 at 1:14 pm #46308Henrik Leth
ParticipantYou cannot access this content.
December 6, 2023 at 1:39 pm #46309Ernest Marcinko
KeymasterOkay, that very likely explains it.
The products are probably created, saved and then the custom fields are added afterwards programmatically. However after adding a custom field
will not trigger the index, as it is bound to the post creation/modification hooks.
I strongly recommend triggering the save_post hook, as it will automatically execute any maintenance related tasks for wordpress after the custom fields were added as well – this is basically a way to tell the system that a post/cpt had been modified.
Alternatively you can enable this option to trigger an index during programmatical custom field changes, however that can be very CPU intensive as it triggers a lot, so definitely monitor the server during imports to make sure it does not time out.Unfortunately the missing custom fields can only be added either by:
– triggering the save_post hook for each of the newly imported posts – probably the easiest solution
– manually removing the newer posts data from the index via IDs from the wp_asp_index table and then “continue index” to refresh the data – this can be also very simple by running an SQL command on the table
– or deleting and recreating the whole index
..as it is not possible to determine which of the posts have missing SKU data from the index.December 6, 2023 at 1:53 pm #46313Henrik Leth
ParticipantYou cannot access this content.
December 6, 2023 at 1:56 pm #46315Ernest Marcinko
KeymasterYou are welcome Henrik.
Most definitely. Some import/export solutions do that automatically, but it’s not very well documented and not mandatory at all when adding custom fields. I first met with this issue about 8 years ago, and still often times see this – hence I added an option to trigger the index when custom fields are added to the post. But that is not a very clean solution unfortunately.
December 6, 2023 at 2:16 pm #46322Henrik Leth
ParticipantYou cannot access this content.
December 6, 2023 at 2:17 pm #46323Ernest Marcinko
KeymasterThank you very much 🙂 Agreed, they will resolve this in no time for sure.
-
AuthorPosts
- You must be logged in to reply to this topic.