I want to retrieve all my searchable document from cloudsearch
I tried to do a negative search like that:
search-[mySearchEndPoint].cloudsearch.amazonaws.com/2011-02-01/search?bq=(not keywords: '!!!testtest!!!')
It work's but it also return all the deleted documents.
So how can I get all active document only?
The key thing to know is that CloudSearch doesn't really delete. Instead, the "delete" function retains IDs in the index, but clears all fields in those deleted docs, including setting uint fields to 0. This works fine for positive queries, which will match no text in the cleared, "deleted" docs.
A workaround is to add a uint field to your docs, called 'updated' below, to use as a filter for queries that might return deleted IDs, such as negative queries.
(The samples below uses the Boto interface library for CloudSearch, with many steps omitted for brevity.)
When you add docs, set the field to the current timestamp
when you delete, CloudSearch sets uint fields to 0:
Now you can distinguish between deleted and active docs in a negative query. The samples below are searching a test index with 86 docs, about half of them deleted.
I think you can do that like this:
Attention to the '-' in the begin of the term