Skip to content

Commit 362cd6b

Browse files
feat(specs): deleteByParams (#1016)
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 735732b commit 362cd6b

File tree

4 files changed

+68
-33
lines changed

4 files changed

+68
-33
lines changed

specs/common/schemas/SearchParams.yml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ baseSearchParamsWithoutQuery:
3131
x-categories:
3232
- Search
3333
filters:
34-
type: string
35-
description: Filter the query with numeric, facet and/or tag filters.
36-
default: ''
37-
x-categories:
38-
- Filtering
34+
$ref: '#/filters'
3935
facetFilters:
4036
$ref: '#/facetFilters'
4137
optionalFilters:
@@ -91,17 +87,9 @@ baseSearchParamsWithoutQuery:
9187
x-categories:
9288
- Pagination
9389
aroundLatLng:
94-
type: string
95-
description: Search for entries around a central geolocation, enabling a geo search within a circular area.
96-
default: ''
97-
x-categories:
98-
- Geo-Search
90+
$ref: '#/aroundLatLng'
9991
aroundLatLngViaIP:
100-
type: boolean
101-
description: Search for entries around a given location automatically computed from the requester's IP address.
102-
default: false
103-
x-categories:
104-
- Geo-Search
92+
$ref: '#/aroundLatLngViaIP'
10593
aroundRadius:
10694
$ref: '#/aroundRadius'
10795
aroundPrecision:
@@ -117,21 +105,9 @@ baseSearchParamsWithoutQuery:
117105
x-categories:
118106
- Geo-Search
119107
insideBoundingBox:
120-
type: array
121-
items:
122-
type: number
123-
format: double
124-
description: Search inside a rectangular area (in geo coordinates).
125-
x-categories:
126-
- Geo-Search
108+
$ref: '#/insideBoundingBox'
127109
insidePolygon:
128-
type: array
129-
items:
130-
type: number
131-
format: double
132-
description: Search inside a polygon (in geo coordinates).
133-
x-categories:
134-
- Geo-Search
110+
$ref: '#/insidePolygon'
135111
naturalLanguages:
136112
type: array
137113
items:
@@ -245,6 +221,38 @@ aroundRadiusAll:
245221
type: string
246222
enum: [all]
247223

224+
aroundLatLng:
225+
type: string
226+
description: Search for entries around a central geolocation, enabling a geo search within a circular area.
227+
default: ''
228+
x-categories:
229+
- Geo-Search
230+
231+
aroundLatLngViaIP:
232+
type: boolean
233+
description: Search for entries around a given location automatically computed from the requester's IP address.
234+
default: false
235+
x-categories:
236+
- Geo-Search
237+
238+
insideBoundingBox:
239+
type: array
240+
items:
241+
type: number
242+
format: double
243+
description: Search inside a rectangular area (in geo coordinates).
244+
x-categories:
245+
- Geo-Search
246+
247+
insidePolygon:
248+
type: array
249+
items:
250+
type: number
251+
format: double
252+
description: Search inside a polygon (in geo coordinates).
253+
x-categories:
254+
- Geo-Search
255+
248256
# There is duplicated logic here because we want to keep a correct description
249257
# and using `$ref` override everything.
250258
searchFiltersArrayString:
@@ -262,6 +270,13 @@ listOfSearchFilters:
262270
items:
263271
$ref: '#/mixedSearchFilters'
264272

273+
filters:
274+
type: string
275+
description: Filter the query with numeric, facet and/or tag filters.
276+
default: ''
277+
x-categories:
278+
- Filtering
279+
265280
facetFilters:
266281
description: Filter hits by facet value.
267282
oneOf:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
deleteByParams:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
facetFilters:
6+
$ref: '../../../common/schemas/SearchParams.yml#/facetFilters'
7+
filters:
8+
$ref: '../../../common/schemas/SearchParams.yml#/filters'
9+
numericFilters:
10+
$ref: '../../../common/schemas/SearchParams.yml#/numericFilters'
11+
tagFilters:
12+
$ref: '../../../common/schemas/SearchParams.yml#/tagFilters'
13+
aroundLatLng:
14+
$ref: '../../../common/schemas/SearchParams.yml#/aroundLatLng'
15+
aroundRadius:
16+
$ref: '../../../common/schemas/SearchParams.yml#/aroundRadius'
17+
insideBoundingBox:
18+
$ref: '../../../common/schemas/SearchParams.yml#/insideBoundingBox'
19+
insidePolygon:
20+
$ref: '../../../common/schemas/SearchParams.yml#/insidePolygon'

specs/search/paths/objects/deleteBy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ post:
1616
content:
1717
application/json:
1818
schema:
19-
$ref: '../../../common/schemas/SearchParams.yml#/searchParams'
19+
$ref: '../../common/schemas/DeleteByParams.yml#/deleteByParams'
2020
responses:
2121
'200':
2222
$ref: '../../../common/responses/DeletedAt.yml'

tests/CTS/methods/requests/search/deleteBy.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
{
33
"parameters": {
44
"indexName": "theIndexName",
5-
"searchParams": {
6-
"query": "testQuery"
5+
"deleteByParams": {
6+
"filters": "brand:brandName"
77
}
88
},
99
"request": {
1010
"path": "/1/indexes/theIndexName/deleteByQuery",
1111
"method": "POST",
1212
"body": {
13-
"query": "testQuery"
13+
"filters": "brand:brandName"
1414
}
1515
}
1616
}

0 commit comments

Comments
 (0)