Deleted products are not removed from index

  • HaikoG
    3 years, 10 months ago #20126


    I noticed that products I remove from Woocommerce aren’t removed from the index.
    When manually triggering (on wp shell)add_remove_document_to_solr_index with the ID of the productthat should be removed, a ‘php notice’ is thrown and the product remains in the index

    add_remove_document_to_solr_index(420788, get_post(420788))

    Notice: Trying to get property ‘post_status’ of non-object in ../plugins/wpsolr-pro/wpsolr/core/ on line 157
    Notice: Trying to get property ‘post_type’ of non-object in ../plugins/wpsolr-pro/wpsolr/core/ on line 162
    => NULL

    How does one remove an item from the index that no longer exist in WordPress?

    3 years, 10 months ago #20132

    Some of your posts have been deleted, but remain in the index. It can happen when SQL is used to remove posts rather than the standard WP API. Typically, WP All Import does that to speed up deletion, but we have an add-on for this plugin to fix the issue.

    In your current state, all you can do is either:
    – Delete you index content, and reindex
    – Create a new index, index it, and use it in search by selecting it in tab “2.”

    More details in here:

    Best practice to Import data in WordPress & Elasticsearch

    • This reply was modified 3 years, 10 months ago by wpsolr.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.