Hi All,
I have a parent / child relationship.
Parents are books and Children are user’s comment.
book { title, author, xxx, yyy, zzz }
usercomment { userid, comment)
I need to delete all children created by a specific user for all books, with the JAVA API,
without iterating over all books.
I use the 5.3.0 release.
I try this code :
QueryBuilder query = termQuery("userid", "3");
DeleteByQueryRequestBuilder deleteQuery = new DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE);
SearchResponse response = deleteQuery.source()
.setIndices(index)
.setTypes(usercomment_type)
.setQuery(query)
.execute().actionGet();
response.getHits().getTotalHits() returns the correct number but nothing is deleted.
What do I miss ?
Thanks for your help.
François