Search code examples
amazon-web-servicesamazon-cloudsearch

Amazon CloudSearch - documents not deleted from index


I have a problem deleting documents from Amazon CloudSearch.

When I send document for deletion I receive response

{"status": "success", "adds": 0, "deletes": 5}

And then the video stays in the index with all fields reset to their default values and not deleted.

The documentation is not clear if this is the normal behaviour or a bug.

Any one else experienced this?


Solution

  • This surprised me too but appears to be normal behavior. The 'deleted' documents aren't searchable anymore since their fields are all null so they shouldn't cause any problems.

    The problem I have with this is that they can be returned if you search for something like "-zomgwtfbbq", since they don't contain the term "zomgwtfbbq".

    It is also confusing since it makes your dashboard show one count (the "searchable" documents) but if you run a test search for -zomgwtfbbq (what I have been using as a proxy for "get all documents"), you get a different number. Took me a while to figure out why.

    Despite what they say about setting the version to max uint32 "permanently removing" the document, it will still be there. The problem is that they consider these documents unsearchable, but they're not.