Skip to content

Commit 7693f92

Browse files
[ci skip]
Improve the examples of filters with tags by specifying '_tags:' [This list might not be relevant] Improve the examples of filters with tags by specifying '_tags:' Fix markup on Android
1 parent 0b179ed commit 7693f92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ You can also use a string array encoding (for example `numericFilters: ["price>1
10451045
</td>
10461046
<td class='client-readme-param-content'>
10471047
<p>Filter the query with numeric, facet or/and tag filters. The syntax is a SQL like syntax, you can use the OR and AND keywords. The syntax for the underlying numeric, facet and tag filters is the same than in the other filters:
1048-
<code>available=1 AND (category:Book OR NOT category:Ebook) AND public</code>
1048+
<code>available=1 AND (category:Book OR NOT category:Ebook) AND _tags:public</code>
10491049
<code>date: 1441745506 TO 1441755506 AND inStock &gt; 0 AND author:&quot;John Doe&quot;</code></p>
10501050

10511051
<p>If no attribute name is specified, the filter applies to <code>_tags</code>. For example: <code>public OR user_42</code> will translate to <code>_tags:public OR _tags:user_42</code>.</p>
@@ -1111,7 +1111,7 @@ You can send multiple queries with a single API call using a batch of queries:
11111111
# - 1st query targets index `categories`
11121112
# - 2nd and 3rd queries target index `products`
11131113
results = self.client.multiple_queries([{"indexName" : "categories", "query" : myQueryString, "hitsPerPage": 3}
1114-
, {"indexName" : "categories", "query" : myQueryString, "hitsPerPage": 3, "filters": "promotion"}
1114+
, {"indexName" : "categories", "query" : myQueryString, "hitsPerPage": 3, "filters": "_tags:promotion"}
11151115
, {"indexName" : "categories", "query" : myQueryString, "hitsPerPage": 10}])
11161116

11171117
print results["results"]
@@ -2182,7 +2182,7 @@ You may have a single index containing **per user** data. In that case, all reco
21822182
```python
21832183
# generate a public API key for user 42. Here, records are tagged with:
21842184
# - 'user_XXXX' if they are visible by user XXXX
2185-
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'filters': 'user_42'})
2185+
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'filters': '_tags:user_42'})
21862186
```
21872187

21882188
This public API key can then be used in your JavaScript code as follow:
@@ -2207,7 +2207,7 @@ You can mix rate limits and secured API keys by setting a `userToken` query para
22072207
```python
22082208
# generate a public API key for user 42. Here, records are tagged with:
22092209
# - 'user_XXXX' if they are visible by user XXXX
2210-
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'filters': 'user_42', 'userToken': 'user_42'})
2210+
public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'filters': '_tags:user_42', 'userToken': 'user_42'})
22112211
```
22122212

22132213
This public API key can then be used in your JavaScript code as follow:

0 commit comments

Comments
 (0)