Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Sku isn't searchable for new products › Reply To: Sku isn't searchable for new products
Okay, 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.