Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Add open-api.yaml prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
gmourier committed Feb 28, 2022
1 parent 80a973d commit 5245d78
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 1 deletion.
127 changes: 127 additions & 0 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,39 @@ components:
- exactness
- 'release_date:asc'
examples: []
typoTolerance:
type: object
description: Customize typo tolerance feature.
properties:
enabled:
description: Enable the typo tolerance feature.
type: boolean
default: true
nullable: false
disableOnAttributes:
description: Disable the typo tolerance feature on the specified attributes.
type: array
items:
type: string
default: []
nullable: false
disableOnWords:
description: Disable the typo tolerance feature for a set of query terms given during a search query.
type: array
items:
type: string
default: []
nullable: false
minWordSizeFor1Typo:
description: Customize the minimum size for a word to tolerate 1 typo.
type: integer
default: 5
nullable: false
minWordSizeFor2Typos:
description: Customize the minimum size for a word to tolerate 2 typos.
type: integer
default: 9
nullable: false
filterableAttributes:
type: array
description: |
Expand Down Expand Up @@ -453,6 +486,8 @@ components:
$ref: '#/components/schemas/searchableAttributes'
displayedAttributes:
$ref: '#/components/schemas/displayedAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
required:
- synonyms
- stopWords
Expand All @@ -461,6 +496,7 @@ components:
- distinctAttribute
- searchableAttributes
- displayedAttributes
- typoTolerance
stats:
type: object
additionalProperties: false
Expand Down Expand Up @@ -1602,6 +1638,8 @@ paths:
$ref: '#/components/schemas/filterableAttributes'
sortableAttributes:
$ref: '#/components/schemas/sortableAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
required:
- rankingRules
- distinctAttribute
Expand All @@ -1611,6 +1649,7 @@ paths:
- synonyms
- filterableAttributes
- sortableAttributes
- typoTolerance
examples:
Example:
value:
Expand Down Expand Up @@ -1652,6 +1691,15 @@ paths:
- price
- author
- title
typoTolerance:
enabled: true
disableOnAttributes:
- author
- price
disableOnWords:
- Tolkien
minWordSizeFor1Typo: 4
minWordSizeFor2Typos: 8
'401':
$ref: '#/components/responses/401'
'404':
Expand Down Expand Up @@ -1695,6 +1743,8 @@ paths:
$ref: '#/components/schemas/filterableAttributes'
sortableAttributes:
$ref: '#/components/schemas/sortableAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
examples:
Example:
value:
Expand Down Expand Up @@ -1731,6 +1781,15 @@ paths:
- release_date
filterableAttributes: []
sortableAttributes: null
typoTolerance:
enabled: false
disableOnAttributes:
- title
- author
disableOnWords:
- Tolkien
minWordSizeFor1Typo: 4
minWordSizeFor2Typos: 8
responses:
'202':
$ref: '#/components/responses/202'
Expand Down Expand Up @@ -2049,6 +2108,74 @@ paths:
description: Not Found
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/settings/typoTolerance':
get:
operationId: indexes.settings.typoTolerance.get
summary: Get typo tolerance configuration
description: |
Get the typo tolerance configuration of an index.
tags:
- Settings
security:
- apiKey: []
responses:
'200':
description: Ok
content:
application/json:
schema:
$ref: '#/components/schemas/typoTolerance'
'401':
$ref: '#/components/responses/401'
'404':
description: Not Found
post:
operationId: indexes.settings.typoTolerance.update
summary: Update typo tolerance settings
description: |
Update the typo tolerance configuration of an index.
> info
> If the provided index does not exist, it will be created.
tags:
- Settings
security:
- apiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/typoTolerance'
examples: {}
description: ''
responses:
'202':
$ref: '#/components/responses/202'
'401':
$ref: '#/components/responses/401'
'404':
description: Not Found
parameters:
- $ref: '#/components/parameters/Content-Type'
delete:
operationId: indexes.settings.typoTolerance.reset
summary: Reset typo tolerance
description: |
Reset the typo tolerance settings of an index to its default configuration.
tags:
- Settings
security:
- apiKey: []
responses:
'202':
$ref: '#/components/responses/202'
'401':
$ref: '#/components/responses/401'
'404':
description: Not Found
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/settings/filterable-attributes':
get:
operationId: indexes.settings.filterableAttributes.get
Expand Down
2 changes: 1 addition & 1 deletion text/0117-typo-tolerance-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ If the instance is secured by a master-key, the auth layer will return the follo
- Required: True
- Default: `[]`

`disabledOnWords` permits to disable the typo tolerance feature on a set of query terms given during a search query.
`disabledOnWords` permits to disable the typo tolerance feature for a set of query terms given during a search query.

### 1.2.1.4 `minWordSizeFor1Typo`

Expand Down

0 comments on commit 5245d78

Please sign in to comment.