Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Force Reindex on Cron
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 7 months ago.
- AuthorPosts
- October 7, 2019 at 3:17 am #24224
The sites products are being uploaded via an API and while new products are being added they are not causing the site to re-index, I have to delete the current index and install a new one for it to work.
Is there a way that I can set up a CRON to delete then re index the site at certain times? Without Deleting the index first it doesn’t add the new items.
Can you think of another way around this?
October 7, 2019 at 2:05 pm #24231Hi,
Have you tried to enable the built in CRON option to force the indexing of new items? If the items are being added (and not existing updated), then it should do the trick.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 8, 2019 at 2:39 am #24239Yes I have tried that, but it is like it doesn’t recognise there are new items so it doesn’t add the new products.
October 8, 2019 at 2:19 pm #24250Hi,
That sounds very strange. The cron process runs periodically, but it won’t index everything all at once to save resources. If you add for example over 100 items at once, it may take a few executions to index.
You can trigger the deletion of the index table, but then it has to be indexed again, but then again it takes multiple requests to index everything via CRON depedning on the database size. You will have basically an empty index maybe for a couple of hours or even more.
I would rather recommend executing the save_post action hook after each and every item when it is imported. That will automatically trigger everything that is attached to that hook, including the indexing. It might be much easier to add this to the API endpoint, as this should be already executed by default.
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.