Skip to content

feat(specs): deleteByParams #1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 44 additions & 29 deletions specs/common/schemas/SearchParams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ baseSearchParamsWithoutQuery:
x-categories:
- Search
filters:
type: string
description: Filter the query with numeric, facet and/or tag filters.
default: ''
x-categories:
- Filtering
$ref: '#/filters'
facetFilters:
$ref: '#/facetFilters'
optionalFilters:
Expand Down Expand Up @@ -91,17 +87,9 @@ baseSearchParamsWithoutQuery:
x-categories:
- Pagination
aroundLatLng:
type: string
description: Search for entries around a central geolocation, enabling a geo search within a circular area.
default: ''
x-categories:
- Geo-Search
$ref: '#/aroundLatLng'
aroundLatLngViaIP:
type: boolean
description: Search for entries around a given location automatically computed from the requester's IP address.
default: false
x-categories:
- Geo-Search
$ref: '#/aroundLatLngViaIP'
aroundRadius:
$ref: '#/aroundRadius'
aroundPrecision:
Expand All @@ -117,21 +105,9 @@ baseSearchParamsWithoutQuery:
x-categories:
- Geo-Search
insideBoundingBox:
type: array
items:
type: number
format: double
description: Search inside a rectangular area (in geo coordinates).
x-categories:
- Geo-Search
$ref: '#/insideBoundingBox'
insidePolygon:
type: array
items:
type: number
format: double
description: Search inside a polygon (in geo coordinates).
x-categories:
- Geo-Search
$ref: '#/insidePolygon'
naturalLanguages:
type: array
items:
Expand Down Expand Up @@ -245,6 +221,38 @@ aroundRadiusAll:
type: string
enum: [all]

aroundLatLng:
type: string
description: Search for entries around a central geolocation, enabling a geo search within a circular area.
default: ''
x-categories:
- Geo-Search

aroundLatLngViaIP:
type: boolean
description: Search for entries around a given location automatically computed from the requester's IP address.
default: false
x-categories:
- Geo-Search

insideBoundingBox:
type: array
items:
type: number
format: double
description: Search inside a rectangular area (in geo coordinates).
x-categories:
- Geo-Search

insidePolygon:
type: array
items:
type: number
format: double
description: Search inside a polygon (in geo coordinates).
x-categories:
- Geo-Search

# There is duplicated logic here because we want to keep a correct description
# and using `$ref` override everything.
searchFiltersArrayString:
Expand All @@ -262,6 +270,13 @@ listOfSearchFilters:
items:
$ref: '#/mixedSearchFilters'

filters:
type: string
description: Filter the query with numeric, facet and/or tag filters.
default: ''
x-categories:
- Filtering

facetFilters:
description: Filter hits by facet value.
oneOf:
Expand Down
20 changes: 20 additions & 0 deletions specs/search/common/schemas/DeleteByParams.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
deleteByParams:
type: object
additionalProperties: false
properties:
facetFilters:
$ref: '../../../common/schemas/SearchParams.yml#/facetFilters'
filters:
$ref: '../../../common/schemas/SearchParams.yml#/filters'
numericFilters:
$ref: '../../../common/schemas/SearchParams.yml#/numericFilters'
tagFilters:
$ref: '../../../common/schemas/SearchParams.yml#/tagFilters'
aroundLatLng:
$ref: '../../../common/schemas/SearchParams.yml#/aroundLatLng'
aroundRadius:
$ref: '../../../common/schemas/SearchParams.yml#/aroundRadius'
insideBoundingBox:
$ref: '../../../common/schemas/SearchParams.yml#/insideBoundingBox'
insidePolygon:
$ref: '../../../common/schemas/SearchParams.yml#/insidePolygon'
2 changes: 1 addition & 1 deletion specs/search/paths/objects/deleteBy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ post:
content:
application/json:
schema:
$ref: '../../../common/schemas/SearchParams.yml#/searchParams'
$ref: '../../common/schemas/DeleteByParams.yml#/deleteByParams'
responses:
'200':
$ref: '../../../common/responses/DeletedAt.yml'
Expand Down
6 changes: 3 additions & 3 deletions tests/CTS/methods/requests/search/deleteBy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{
"parameters": {
"indexName": "theIndexName",
"searchParams": {
"query": "testQuery"
"deleteByParams": {
"filters": "brand:brandName"
}
},
"request": {
"path": "/1/indexes/theIndexName/deleteByQuery",
"method": "POST",
"body": {
"query": "testQuery"
"filters": "brand:brandName"
}
}
}
Expand Down