Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Sku isn't searchable for new products
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 9 months ago.
- AuthorPosts
- December 5, 2023 at 2:18 pm #46301
Hi 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 LethAttachments:
You must be logged in to view attached files.December 6, 2023 at 1:10 pm #46307Hi,
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?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 6, 2023 at 1:14 pm #46308You cannot access this content.December 6, 2023 at 1:39 pm #46309Okay, 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:
Best,
– 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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 6, 2023 at 1:53 pm #46313You cannot access this content.December 6, 2023 at 1:56 pm #46315You 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.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 6, 2023 at 2:16 pm #46322You cannot access this content.December 6, 2023 at 2:17 pm #46323Thank you very much 🙂 Agreed, they will resolve this in no time for sure.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.