File tree Expand file tree Collapse file tree 11 files changed +60
-43
lines changed
templates/javascript/clients/client/api
tests/CTS/methods/requests/search Expand file tree Collapse file tree 11 files changed +60
-43
lines changed Original file line number Diff line number Diff line change 1
- 0.0.12
1
+ 0.0.13
Original file line number Diff line number Diff line change @@ -232,11 +232,6 @@ page:
232
232
x-categories :
233
233
- Pagination
234
234
235
- cursor :
236
- type : string
237
- description : Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
238
- example : jMDY3M2MwM2QwMWUxMmQwYWI0ZTN
239
-
240
235
aroundRadius :
241
236
description : Define the maximum radius for a geo search (in meters).
242
237
oneOf :
Original file line number Diff line number Diff line change
1
+ browseParams :
2
+ oneOf :
3
+ - $ref : ' ../../../common/schemas/SearchParams.yml#/searchParamsString'
4
+ - $ref : ' #/browseParamsObject'
5
+
6
+ browseParamsObject :
7
+ allOf :
8
+ - $ref : ' ../../../common/schemas/SearchParams.yml#/searchParamsObject'
9
+ - $ref : ' #/cursor'
10
+
11
+ cursor :
12
+ type : object
13
+ additionalProperties : false
14
+ properties :
15
+ cursor :
16
+ type : string
17
+ description : Cursor indicating the location to resume browsing from. Must match the value returned by the previous call.
18
+ example : jMDY3M2MwM2QwMWUxMmQwYWI0ZTN
Original file line number Diff line number Diff line change
1
+ browseResponse :
2
+ allOf :
3
+ - $ref : ' ./SearchResponse.yml#/baseSearchResponse'
4
+ - $ref : ' ./SearchResponse.yml#/searchHits'
5
+ - $ref : ' ./BrowseParams.yml#/cursor'
Original file line number Diff line number Diff line change 1
- SearchResponse :
1
+ searchResponse :
2
2
allOf :
3
3
- $ref : ' #/baseSearchResponse'
4
4
- $ref : ' #/searchHits'
5
5
6
- browseResponse :
7
- allOf :
8
- - $ref : ' #/baseSearchResponse'
9
- - $ref : ' #/searchHits'
10
- - $ref : ' #/baseBrowseResponse'
11
-
12
- baseBrowseResponse :
13
- type : object
14
- additionalProperties : false
15
- properties :
16
- cursor :
17
- $ref : ' ../../../common/schemas/SearchParams.yml#/cursor'
18
-
19
6
searchHits :
20
7
type : object
21
8
additionalProperties : false
Original file line number Diff line number Diff line change @@ -15,21 +15,14 @@ post:
15
15
content :
16
16
application/json :
17
17
schema :
18
- title : browseRequest
19
- type : object
20
- additionalProperties : false
21
- properties :
22
- params :
23
- $ref : ' ../../../common/schemas/SearchParams.yml#/paramsAsString'
24
- cursor :
25
- $ref : ' ../../../common/schemas/SearchParams.yml#/cursor'
18
+ $ref : ' ../../common/schemas/BrowseParams.yml#/browseParams'
26
19
responses :
27
20
' 200 ' :
28
21
description : OK
29
22
content :
30
23
application/json :
31
24
schema :
32
- $ref : ' ../../common/schemas/SearchResponse .yml#/browseResponse'
25
+ $ref : ' ../../common/schemas/BrowseResponse .yml#/browseResponse'
33
26
' 400 ' :
34
27
$ref : ' ../../../common/responses/BadRequest.yml'
35
28
' 402 ' :
Original file line number Diff line number Diff line change 38
38
results :
39
39
type : array
40
40
items :
41
- $ref : ' ../../common/schemas/SearchResponse.yml#/SearchResponse '
41
+ $ref : ' ../../common/schemas/SearchResponse.yml#/searchResponse '
42
42
required :
43
43
- results
44
44
' 400 ' :
Original file line number Diff line number Diff line change 19
19
content :
20
20
application/json :
21
21
schema :
22
- $ref : ' ../../common/schemas/SearchResponse.yml#/SearchResponse '
22
+ $ref : ' ../../common/schemas/SearchResponse.yml#/searchResponse '
23
23
' 400 ' :
24
24
$ref : ' ../../../common/responses/BadRequest.yml'
25
25
' 402 ' :
Original file line number Diff line number Diff line change @@ -113,15 +113,15 @@ waitForApiKey(
113
113
* @summary Helper method that iterates on the `browse` method.
114
114
* @param browseObjects - The browseObjects object.
115
115
* @param browseObjects.indexName - The index in which to perform the request.
116
- * @param browseObjects.browseRequest - The `browse` method parameters.
116
+ * @param browseObjects.browseParams - The `browse` parameters.
117
117
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call. By default, stops when there is no `cursor` in the response.
118
118
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
119
119
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `browse` method and merged with the transporter requestOptions.
120
120
*/
121
121
browseObjects<T >(
122
122
{
123
123
indexName,
124
- browseRequest ,
124
+ browseParams ,
125
125
...browseObjectsOptions
126
126
} : BrowseOptions<BrowseResponse <T >> & BrowseProps,
127
127
requestOptions?: RequestOptions
@@ -131,9 +131,9 @@ browseObjects<T>(
131
131
return this.browse(
132
132
{
133
133
indexName,
134
- browseRequest : {
134
+ browseParams : {
135
135
cursor: previousResponse ? previousResponse.cursor : undefined,
136
- ...browseRequest ,
136
+ ...browseParams ,
137
137
} ,
138
138
},
139
139
requestOptions
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
- "testName" : " get browse results with minimal parameters" ,
3
+ "testName" : " browse with minimal parameters" ,
4
4
"parameters" : {
5
5
"indexName" : " indexName"
6
6
},
10
10
}
11
11
},
12
12
{
13
- "testName" : " get browse results with all parameters" ,
13
+ "testName" : " browse with search parameters" ,
14
14
"parameters" : {
15
15
"indexName" : " indexName" ,
16
- "browseRequest" : {
17
- "params" : " query=foo&facetFilters=['bar']" ,
18
- "cursor" : " cts"
16
+ "browseParams" : {
17
+ "query" : " myQuery" ,
18
+ "facetFilters" : [
19
+ " tags:algolia"
20
+ ]
19
21
}
20
22
},
21
23
"request" : {
22
24
"path" : " /1/indexes/indexName/browse" ,
23
25
"method" : " POST" ,
24
26
"body" : {
25
- "params" : " query=foo&facetFilters=['bar']" ,
26
- "cursor" : " cts"
27
+ "query" : " myQuery" ,
28
+ "facetFilters" : [
29
+ " tags:algolia"
30
+ ]
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "testName" : " browse allow a cursor in parameters" ,
36
+ "parameters" : {
37
+ "indexName" : " indexName" ,
38
+ "browseParams" : {
39
+ "cursor" : " test"
40
+ }
41
+ },
42
+ "request" : {
43
+ "path" : " /1/indexes/indexName/browse" ,
44
+ "method" : " POST" ,
45
+ "body" : {
46
+ "cursor" : " test"
27
47
}
28
48
}
29
49
}
Original file line number Diff line number Diff line change 10
10
}
11
11
},
12
12
{
13
- "method" : " search" ,
14
13
"testName" : " search with searchParams" ,
15
14
"parameters" : {
16
15
"indexName" : " indexName" ,
You can’t perform that action at this time.
0 commit comments