deleted items still showing in suggestions
9 months, 3 weeks ago #29808
when deleting items from woocommerce via
$product = wc_get_product($id);
The items still show in the suggestions dropdown without image or link, but it doesn’t show in search page.
9 months, 3 weeks ago #29810
- This topic was modified 9 months, 3 weeks ago by wpsolr.
Yes it is still in the index.
Here is the screenshot of the response of a direct call to elastic search.
9 months, 3 weeks ago #29811
WPSOLR removes a post from the index when the WP ‘save_post’ hook is sent, for instance when a post is trashed.
But I just noticed that wp_delete_post() does not send the hook ‘save_post’.
To fix this issue, the hook ‘after_delete_post’ will be added on next WPSOLR release.
For now, you could trash the product before deleting it to remove it from the index.
Or change line 116 of file /wpsolr-pro/wpsolr/core/wpsolr_include.inc.php :
add_action( 'save_post', 'add_remove_document_to_solr_index', 999, 3 );
add_action( 'save_post', 'add_remove_document_to_solr_index', 999, 3 ); do_action( 'after_delete_post', 'add_remove_document_to_solr_index', 10, 2 );
9 months, 3 weeks ago #29813
- This reply was modified 9 months, 3 weeks ago by wpsolr.
Thank you9 months, 3 weeks ago #29815
This fix did not resolve the issue.
Please help urgently we cannot delete the index every bit and reindex again, we have more than 500k items.9 months, 3 weeks ago #29861
Additionally, even when a product is deleted or trashed from the dashboard, it does not get removed from the index.9 months, 3 weeks ago #29863
No, it was there even before.9 months, 3 weeks ago #29864
There is another issue we also noticed when we first installed the plugin.
we are using Dokan with woocommerce, when we disable a vendor, their products do not get removed from the index also. but I will open a separate thread for this as I need the check the status of products when the vendor is disabled9 months, 3 weeks ago #29866
Ok, what about the deleted items issue?9 months, 3 weeks ago #29870
But delete is done from Woocommerce dashboard, and we are using WordPress’s (wp_delete_post and wp_trash_post) and Woocommerce’s ($product->delete()) core functionalities to delete products and it is not working
You must be logged in to reply to this topic.