On my side, I used a local nodejs script like this:
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '<your AccessKey>',
secretAccessKey: '<Your secretAccessKey>',
region: '<your region>',
endpoint: '<your CloudSearch endpoint'
});
var params = {
query:"(or <your facet.FIELD:'<one facet value>' facet.FIELD:'<one facet value>')",
queryParser:'structured'
};
var cloudsearchdomain = new AWS.CloudSearchDomain(params);
cloudsearchdomain.search(params, function(err, data) {
var fs = require('fs');
var result = [];
if (err) {
console.log("Failed");
console.log(err);
} else {
resultMessage = data;
for(var i=0;i<data.hits.hit.length;i++){
result.push({"type":"delete","id":data.hits.hit[i].id});
}
fs.writeFile("delete.json", JSON.stringify(result), function(err) {
if(err) {return console.log(err);}
console.log("The file was saved!");
});
}
});
You have to know at least all the values of on facets, to be able to request all IDs. In my code, I just put 2 (in (or ....) section), but you can have more.
Once it is done, you have one delete.json file to be used with AWS-CLI using this command :
aws cloudsearchdomain upload-documents --documents delete.json --content-type application/json --endpoint-url <your CloudSearch endpoint>
... that did the job for me !