Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit d18918f

Browse files
docs(README): automatic update
Update README Android [This list might not be relevant] Add a warning informing about the maxValuesPerFacet hard limit of 1000 (#125) Merge branch 'master' of github.com:algolia/algoliasearch-client-readme-generator improve api keys section iteration on api keys Fix some typos iteration on api keys iteration on api keys Add TOC for recently added geo search parameters Add missing `aroundRadius`, `aroundPrecision` and `minimumAroundRadius` search parameters Reformatting and rephrasing Ensure code blocks and lists are separated by a blank line Some Markdown processors (such as that used by Jazzy) are very picky about that. If a list or a code block is not separated from the previous paragraph by a blank line, it gets treated as a continuation of the paragraph, resulting in the loss of formatting. fix case sensitive issue Add parameter `minProximity` Add parameter `replaceSynonymsInHighlight` Add search parameter `synonyms` Add parameter `analyticsTags` Fix search parameter TOCs I added a small shell script to compute a draft of the TOC from the file’s contents. [ci skip]
1 parent a00949b commit d18918f

File tree

1 file changed

+131
-49
lines changed

1 file changed

+131
-49
lines changed

README.md

Lines changed: 131 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ The server response will look like:
332332

333333
- `nbHits` (integer): Number of hits that the search query matched.
334334

335-
- `page` (integer): Index of the current page (zero-based). See the [`page`](#page) search parameter.
335+
- `page` (integer): Index of the current page (zero-based). See the [`page`](#page) search parameter. *Note: Not returned if you use `offset`/`length` for pagination.*
336336

337-
- `hitsPerPage` (integer): Maximum number of hits returned per page. See the [`hitsPerPage`](#hitsperpage) search parameter.
337+
- `hitsPerPage` (integer): Maximum number of hits returned per page. See the [`hitsPerPage`](#hitsperpage) search parameter. *Note: Not returned if you use `offset`/`length` for pagination.*
338338

339-
- `nbPages` (integer): Number of pages corresponding to the number of hits. Basically, `ceil(nbHits / hitsPerPage)`.
339+
- `nbPages` (integer): Number of pages corresponding to the number of hits. Basically, `ceil(nbHits / hitsPerPage)`. *Note: Not returned if you use `offset`/`length` for pagination.*
340340

341341
- `processingTimeMS` (integer): Time that the server took to process the request, in milliseconds. *Note: This does not include network time.*
342342

@@ -356,7 +356,7 @@ When [`getRankingInfo`](#getrankinginfo) is set to `true`, the following additio
356356

357357
- `serverUsed` (string): Actual host name of the server that processed the request. (Our DNS supports automatic failover and load balancing, so this may differ from the host name used in the request.)
358358

359-
- `parsedQuery` (string): The query string that will be searched, after normalization.
359+
- `parsedQuery` (string): The query string that will be searched, after normalization. Normalization includes removing stop words (if [removeStopWords](#removestopwords) is enabled), and transforming portions of the query string into phrase queries (see [advancedSyntax](#advancedsyntax)).
360360

361361
- `timeoutCounts` (boolean): Whether a timeout was hit when computing the facet counts. When `true`, the counts will be interpolated (i.e. approximate). See also `exhaustiveFacetsCount`.
362362

@@ -400,6 +400,7 @@ Parameters that can also be used in a setSettings also have the `indexing` [scop
400400
**Attributes**
401401

402402
- [attributesToRetrieve](#attributestoretrieve) `settings`, `search`
403+
- [restrictSearchableAttributes](#restrictsearchableattributes) `search`
403404

404405
**Filtering / Faceting**
405406

@@ -414,11 +415,14 @@ Parameters that can also be used in a setSettings also have the `indexing` [scop
414415
- [highlightPreTag](#highlightpretag) `settings`, `search`
415416
- [highlightPostTag](#highlightposttag) `settings`, `search`
416417
- [snippetEllipsisText](#snippetellipsistext) `settings`, `search`
418+
- [restrictHighlightAndSnippetArrays](#restricthighlightandsnippetarrays) `settings`, `search`
417419

418420
**Pagination**
419421

420422
- [page](#page) `search`
421423
- [hitsPerPage](#hitsperpage) `settings`, `search`
424+
- [offset](#offset) `search`
425+
- [length](#length) `search`
422426

423427
**Typos**
424428

@@ -446,6 +450,7 @@ Parameters that can also be used in a setSettings also have the `indexing` [scop
446450
- [advancedSyntax](#advancedsyntax) `settings`, `search`
447451
- [optionalWords](#optionalwords) `settings`, `search`
448452
- [removeStopWords](#removestopwords) `settings`, `search`
453+
- [disableExactOnAttributes](#disableexactonattributes) `settings`, `search`
449454
- [exactOnSingleWordQuery](#exactonsinglewordquery) `settings`, `search`
450455
- [alternativesAsExact](#alternativesasexact) `settings`, `search`
451456

@@ -457,9 +462,55 @@ Parameters that can also be used in a setSettings also have the `indexing` [scop
457462
- [tagFilters (deprecated)](#tagfilters-deprecated) `search`
458463
- [facetFilters (deprecated)](#facetfilters-deprecated) `search`
459464
- [analytics](#analytics) `search`
465+
- [analyticsTags](#analyticstags) `search`
466+
- [synonyms](#synonyms) `search`
467+
- [replaceSynonymsInHighlight](#replacesynonymsinhighlight) `search`, `settings`
468+
- [minProximity](#minproximity) `search`, `settings`
460469

461470
<!--/PARAMETERS_LINK-->
462471

472+
### Multiple queries - `multipleQueriesAsync`
473+
474+
You can send multiple queries with a single API call using a batch of queries:
475+
476+
```java
477+
// perform 3 queries in a single API call:
478+
// - 1st query targets index `categories`
479+
// - 2nd and 3rd queries target index `products`
480+
481+
List<IndexQuery> queries = new ArrayList<>();
482+
483+
queries.add(new IndexQuery("categories", new Query(myQueryString).setHitsPerPage(3)));
484+
queries.add(new IndexQuery("products", new Query(myQueryString).setHitsPerPage(3).set("filters", "_tags:promotion"));
485+
queries.add(new IndexQuery("products", new Query(myQueryString).setHitsPerPage(10)));
486+
487+
client.multipleQueriesAsync(queries, new CompletionHandler() {
488+
@Override
489+
public void requestCompleted(JSONObject content, AlgoliaException error) {
490+
// [...]
491+
}
492+
});
493+
```
494+
495+
You can specify a `strategy` parameter to optimize your multiple queries:
496+
497+
- `none`: Execute the sequence of queries until the end.
498+
- `stopIfEnoughMatches`: Execute the sequence of queries until the number of hits is reached by the sum of hits.
499+
500+
#### Response
501+
502+
The resulting JSON contains the following fields:
503+
504+
- `results` (array): The results for each request, in the order they were submitted. The contents are the same as in [Search in an index](#search-in-an-index---searchasync).
505+
506+
Each result also includes the following additional fields:
507+
508+
- `index` (string): The name of the targeted index.
509+
510+
- `processed` (boolean, optional): *Note: Only returned when `strategy` is `stopIfEnoughmatches`.* Whether the query was processed.
511+
512+
513+
463514
### Find by IDs - `getObjectsAsync`
464515

465516
You can easily retrieve an object using its `objectID` and optionally specify a comma separated list of attributes you want:
@@ -831,11 +882,11 @@ They are three scopes:
831882

832883
**Attributes**
833884

834-
- [attributesForFaceting](#attributesforfaceting) `settings`
835885
- [attributesToIndex](#attributestoindex) `settings`
836-
- [attributesToRetrieve](#attributestoretrieve) `settings`, `search`
886+
- [attributesForFaceting](#attributesforfaceting) `settings`
837887
- [unretrievableAttributes](#unretrievableattributes) `settings`
838-
888+
- [attributesToRetrieve](#attributestoretrieve) `settings`, `search`
889+
- [restrictSearchableAttributes](#restrictsearchableattributes) `search`
839890

840891
**Ranking**
841892

@@ -862,6 +913,8 @@ They are three scopes:
862913

863914
- [page](#page) `search`
864915
- [hitsPerPage](#hitsperpage) `settings`, `search`
916+
- [offset](#offset) `search`
917+
- [length](#length) `search`
865918

866919
**Typos**
867920

@@ -906,8 +959,12 @@ They are three scopes:
906959
- [tagFilters (deprecated)](#tagfilters-deprecated) `search`
907960
- [facetFilters (deprecated)](#facetfilters-deprecated) `search`
908961
- [analytics](#analytics) `search`
909-
- [altCorrections](#altcorrections) `settings`
962+
- [analyticsTags](#analyticstags) `search`
963+
- [synonyms](#synonyms) `search`
964+
- [replaceSynonymsInHighlight](#replacesynonymsinhighlight) `search`, `settings`
910965
- [placeholders](#placeholders) `settings`
966+
- [altCorrections](#altcorrections) `settings`
967+
- [minProximity](#minproximity) `search`, `settings`
911968

912969
### Search
913970

@@ -1148,6 +1205,10 @@ Limit the number of facet values returned for each facet.
11481205
11491206
For example, `maxValuesPerFacet=10` will retrieve a maximum of 10 values per facet.
11501207
1208+
**Warnings**
1209+
1210+
- The engine has a hard limit on the `maxValuesPerFacet` of `1000`. Any value above that will be interpreted by the engine as being `1000`.
1211+
11511212
### Highlighting / Snippeting
11521213
11531214
#### attributesToHighlight
@@ -1247,6 +1308,28 @@ Pagination parameter used to select the page to retrieve.
12471308
12481309
Pagination parameter used to select the number of hits per page.
12491310
1311+
#### offset
1312+
1313+
- scope: `search`
1314+
- type: `integer`
1315+
- default: `null`
1316+
1317+
1318+
Offset of the first hit to return (zero-based).
1319+
1320+
**Warning:** In most cases, `page`/`hitsPerPage` is the recommended method for pagination; `offset`/`length` is reserved for advanced use.
1321+
1322+
#### length
1323+
1324+
- scope: `search`
1325+
- type: `integer`
1326+
- default: `null`
1327+
1328+
1329+
Number of hits to return.
1330+
1331+
**Warning:** In most cases, `page`/`hitsPerPage` is the recommended method for pagination; `offset`/`length` is reserved for advanced use.
1332+
12501333
### Typos
12511334
12521335
#### minWordSizefor1Typo
@@ -1770,6 +1853,33 @@ For example, `[["category:Book","category:Movie"],"author:John%20Doe"]`.
17701853

17711854
If set to false, this query will not be taken into account in the analytics feature.
17721855

1856+
#### analyticsTags
1857+
1858+
- scope: `search`
1859+
- type: `array of strings`
1860+
- default: `null`
1861+
1862+
1863+
If set, tag your query with the specified identifiers. Tags can then be used in the Analytics to analyze a subset of searches only.
1864+
1865+
#### synonyms
1866+
1867+
- scope: `search`
1868+
- type: `boolean`
1869+
- default: `true`
1870+
1871+
1872+
If set to `false`, the search will not use the synonyms defined for the targeted index.
1873+
1874+
#### replaceSynonymsInHighlight
1875+
1876+
- scope: `search`, `settings`
1877+
- type: `boolean`
1878+
- default: `true`
1879+
1880+
1881+
If set to `false`, words matched via synonym expansion will not be replaced by the matched synonym in the highlighted result.
1882+
17731883
#### placeholders
17741884

17751885
- scope: `settings`
@@ -1817,6 +1927,19 @@ For example:
18171927
]
18181928
```
18191929

1930+
#### minProximity
1931+
1932+
- scope: `search`, `settings`
1933+
- type: `integer`
1934+
- default: `1`
1935+
1936+
1937+
Configure the precision of the `proximity` ranking criterion. By default, the minimum (and best) proximity value distance between 2 matching words is 1. Setting it to 2 (or 3) would allow 1 (or 2) words to be found between the matching words without degrading the proximity ranking value.
1938+
1939+
Considering the query *“javascript framework”*, if you set `minProximity=2`, the records *JavaScript framework”* and *JavaScript charting framework”* will get the same proximity score, even if the second contains a word between the two matching words.
1940+
1941+
**Note:** the maximum `minProximity` that can be set is 7. Any higher value will disable the `proximity` criterion from the ranking formula.
1942+
18201943

18211944
## Manage Indices
18221945

@@ -2028,47 +2151,6 @@ iterator.start();
20282151
```
20292152

20302153

2031-
### Multiple queries - `multipleQueriesAsync`
2032-
2033-
You can send multiple queries with a single API call using a batch of queries:
2034-
2035-
```java
2036-
// perform 3 queries in a single API call:
2037-
// - 1st query targets index `categories`
2038-
// - 2nd and 3rd queries target index `products`
2039-
2040-
List<IndexQuery> queries = new ArrayList<>();
2041-
2042-
queries.add(new IndexQuery("categories", new Query(myQueryString).setHitsPerPage(3)));
2043-
queries.add(new IndexQuery("products", new Query(myQueryString).setHitsPerPage(3).set("filters", "_tags:promotion"));
2044-
queries.add(new IndexQuery("products", new Query(myQueryString).setHitsPerPage(10)));
2045-
2046-
client.multipleQueriesAsync(queries, new CompletionHandler() {
2047-
@Override
2048-
public void requestCompleted(JSONObject content, AlgoliaException error) {
2049-
// [...]
2050-
}
2051-
});
2052-
```
2053-
2054-
You can specify a `strategy` parameter to optimize your multiple queries:
2055-
2056-
- `none`: Execute the sequence of queries until the end.
2057-
- `stopIfEnoughMatches`: Execute the sequence of queries until the number of hits is reached by the sum of hits.
2058-
2059-
#### Response
2060-
2061-
The resulting JSON contains the following fields:
2062-
2063-
- `results` (array): The results for each request, in the order they were submitted. The contents are the same as in [Search in an index](#search-in-an-index---searchasync).
2064-
2065-
Each result also includes the following additional fields:
2066-
2067-
- `index` (string): The name of the targeted index.
2068-
2069-
- `processed` (boolean, optional): *Note: Only returned when `strategy` is `stopIfEnoughmatches`.* Whether the query was processed.
2070-
2071-
20722154

20732155
### REST API
20742156

0 commit comments

Comments
 (0)