diff --git a/README.md b/README.md index 2d5b501c..d4c9b0f9 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ Check our [online guides](https://www.algolia.com/doc): Add a new object to the Index ================== -Each entry in an index has a unique identifier called `objectID`. There are two ways to add en entry to the index: +Each entry in an index has a unique identifier called `objectID`. There are two ways to add an entry to the index: 1. Using automatic `objectID` assignment. You will be able to access it in the answer. 2. Supplying your own `objectID`. @@ -1121,7 +1121,7 @@ You can also use a string array encoding (for example `numericFilters: ["price>1 -

Filter the query by a set of tags. You can AND tags by separating them with commas. To OR tags, you must add parentheses. For example, tags=tag1,(tag2,tag3) means tag1 AND (tag2 OR tag3). You can also use a string array encoding. For example, tagFilters: ["tag1",["tag2","tag3"]] means tag1 AND (tag2 OR tag3).

+

Filter the query by a set of tags. You can AND tags by separating them with commas. To OR tags, you must add parentheses. For example, tagFilters=tag1,(tag2,tag3) means tag1 AND (tag2 OR tag3). You can also use a string array encoding. For example, tagFilters: ["tag1",["tag2","tag3"]] means tag1 AND (tag2 OR tag3). Negations are supported via the - operator, prefixing the value. For example: tagFilters=tag1,-tag2.

At indexing, tags should be added in the _tags attribute of objects. For example {"_tags":["tag1","tag2"]}.

@@ -1340,6 +1340,18 @@ You can delete an object using its `objectID`: client.execute { delete from "toto" objectId "oid" } ``` +Delete by query +================== + +You can delete all objects matching a single query with the following code. Internally, the API client performs the query, deletes all matching hits, and waits until the deletions have been applied. + +As the delete by query calls the browse API in sequence, this functionnality is provided in a helper class. + +```scala +val helper = AlgoliaSyncHelper(client) +val query = Query(filters = Some("price > 10")) +val delete = helper.deleteByQuery[MyCaseClass]("myIndex", query) +``` Index Settings