Skip to content

Commit

Permalink
Update README (#104)
Browse files Browse the repository at this point in the history
* Remove Seq in the scala snippet spotted by Rcs

Replace all the example with tagFilters and numericFilters by the new unified filters

*  [ci skip]
  Update README Scala
  [This list might not be relevant]
  Clarification of the filters default attribute name

Merge pull request #59 from algolia/js/examples

docs(js): Give more emphasis on using autocomplete and instantsearch
docs(js): Give more emphasis on using autocomplete and instantsearch

We would like people to use autocomplete and instantsearch instead of
building their UIs manually, so I'm giving a bit more emphasis on
those libraries in the doc.

docs(js): Improve cache documentation

I realized that the previous `cache` documentation was a bit succinct,
so I just expanded it with more context, explanation and examples.

*  [ci skip]
  Update README Scala
  [This list might not be relevant]
  Merge pull request #64 from algolia/ruby/backup-anchor

Fix the anchor to the backup section

*  [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
  • Loading branch information
algoliareadmebot authored and ElPicador committed Jun 6, 2016
1 parent 5424018 commit 25b61f5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ Search

To perform a search, you only need to initialize the index and perform a call to the search function.

The search query allows only to retrieve 1000 hits, if you need to retrieve more than 1000 hits for seo, you can use [Backup / Retrieve all index content](#backup--retrieve-of-all-index-content)
The search query allows only to retrieve 1000 hits, if you need to retrieve more than 1000 hits for seo, you can use [Backup / Retrieve all index content](#backup--export-an-index)

```scala
client.execute {
Expand Down Expand Up @@ -1200,9 +1200,11 @@ You can also use a string array encoding (for example `numericFilters: ["price>1
</td>
<td class='client-readme-param-content'>
<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:
<code>available=1 AND (category:Book OR NOT category:Ebook) AND public</code>
<code>available=1 AND (category:Book OR NOT category:Ebook) AND _tags:public</code>
<code>date: 1441745506 TO 1441755506 AND inStock &gt; 0 AND author:&quot;John Doe&quot;</code></p>

<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>

<p>The list of keywords is:</p>

<ul>
Expand Down Expand Up @@ -1267,7 +1269,7 @@ You can send multiple queries with a single API call using a batch of queries:
val result: Future[MultiQueriesResult] = client.execute {
multiQueries(
search into "categories" query Query(query = myQueryString, hitsPerPage = Some(3)),
search into "products" query Query(query = myQueryString, hitsPerPage = Some(3), tagFilters = Some(Seq("promotion"))),
search into "products" query Query(query = myQueryString, hitsPerPage = Some(3), filters = Some("_tags:promotion")),
search into "products" query Query(query = myQueryString, hitsPerPage = Some(10))
) strategy MultiQueries.Strategy.stopIfEnoughMatches
}
Expand Down Expand Up @@ -2172,7 +2174,7 @@ that it is not possible to access records beyond the 1,000th on the first call.
Example:

```scala
val q = Query(query = Some("text"), numericFilters = Some("i<42"))
val q = Query(query = Some("text"), filters = Some("i<42"))

// Iterate with a filter over the index
val result: Future[BrowseResult] = client.execute {
Expand Down Expand Up @@ -2457,7 +2459,7 @@ You may have a single index containing **per user** data. In that case, all reco
```scala
// generate a public API key for user 42. Here, records are tagged with:
// - 'user_XXXX' if they are visible by user XXXX
String publicKey = client.generateSecuredApiKey("YourSearchOnlyApiKey", Query(tagFilters = Some(Seq("user_42"))))
String publicKey = client.generateSecuredApiKey("YourSearchOnlyApiKey", Query(filters = Some("_tags:user_42")))
```

This public API key can then be used in your JavaScript code as follow:
Expand All @@ -2482,7 +2484,7 @@ You can mix rate limits and secured API keys by setting a `userToken` query para
```scala
// generate a public API key for user 42. Here, records are tagged with:
// - 'user_XXXX' if they are visible by user XXXX
String publicKey = client.generateSecuredApiKey("YourSearchOnlyApiKey", Query(tagFilters = Some(Seq("user_42"))), Some("42"))
String publicKey = client.generateSecuredApiKey("YourSearchOnlyApiKey", Query(filters = Some("_tags:user_42")), Some("42"))
```

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

0 comments on commit 25b61f5

Please sign in to comment.