Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
69e4c9b
Draft file for Typo Tolerance specification
gmourier Feb 22, 2022
b1f09fd
rename spec file
gmourier Feb 22, 2022
47e01a4
Rename specification
gmourier Feb 28, 2022
6ec50da
draft
gmourier Feb 28, 2022
b4399cd
Add open-api.yaml prototype
gmourier Feb 28, 2022
2f0315d
Add typoTolerance component on POST search
gmourier Mar 1, 2022
ad4f576
Add typoTolerance object into search api parameters
gmourier Mar 1, 2022
313f34c
fix typos
gmourier Mar 1, 2022
ed5ce79
remove the past tense
gmourier Mar 1, 2022
62ede7e
Add typoTolerance GET query parameters
gmourier Mar 1, 2022
ca85222
Fix description
gmourier Mar 1, 2022
85033c3
Add explanations for disableOnWords property
gmourier Mar 1, 2022
2e525f3
Update spec href
gmourier Mar 1, 2022
d4eaa21
Describe indexes/:index_uid/settings/typo-tolerance endpoint
gmourier Mar 1, 2022
e6820ac
Explain why it is useful to expose typo tolerance settings at search …
gmourier Mar 2, 2022
6adcd2a
Remove typoTolerance properties at search time
gmourier Mar 2, 2022
dd87e04
Add a future possiblity to change POST verb to PATCH to edit a settin…
gmourier Mar 2, 2022
b2b5df9
Sync spec with telemetry
gmourier Mar 2, 2022
f9a53ea
Mark TODO on technical details and rework structure of specification
gmourier Mar 3, 2022
0ac9a4a
Specify properties required to false to allow partial updates
gmourier Mar 3, 2022
7665427
Add error definitions for typoTolerance API resource properties
gmourier Mar 3, 2022
1e98ea5
Rename spec file
gmourier Mar 3, 2022
3832df4
Restore deleted metric
gmourier Mar 8, 2022
2e325f9
Update text/0117-typo-tolerance-settings-api.md
gmourier Mar 9, 2022
6cb36fc
Update text/0117-typo-tolerance-settings-api.md
gmourier Mar 9, 2022
66319dd
Apply suggestions from code review
gmourier Mar 10, 2022
bc9e61d
Replace W to w in telemtry
gmourier Mar 10, 2022
482a379
Apply consistency on new errors message
gmourier Mar 10, 2022
50fdebd
fix typo
gmourier Mar 10, 2022
3cb5660
Add Async Errors and Lazy Index Creation
gmourier Mar 14, 2022
cbe87d0
Rename telemetry nodes
gmourier Mar 15, 2022
883be59
Mention case insensivity of disableOnWords parameter
gmourier Mar 15, 2022
827c762
Describes synchronous (type-checking) and asynchronous (business log…
gmourier Mar 15, 2022
bf9a74e
Add examples for minWordSizeFor1Typo and minWordSizeFor2Typos
gmourier Mar 15, 2022
3be8cfd
Elaborate on examples
gmourier Mar 15, 2022
af9cdb4
Remove title bullet point
gmourier Mar 15, 2022
c2e4618
Apply naming suggestions
gmourier Mar 16, 2022
b99f3f5
Apply naming changes on telemetry and miss on OpenAPI
gmourier Mar 16, 2022
3a8f0af
Branch typo sub-ressource to settings-api specification
gmourier Mar 16, 2022
0d64e50
Fix typo (lul)
gmourier Mar 16, 2022
547203f
Add Technical Details
gmourier Mar 16, 2022
4064728
Apply suggestions from code review
gmourier Mar 22, 2022
09d600a
Replace minWordSizeForXTypos fields by a minWordSizeForTypos object
gmourier Mar 22, 2022
222c6a5
Update text/0034-telemetry-policies.md
gmourier Mar 22, 2022
06921ac
Apply suggestions from code review
gmourier Mar 30, 2022
ef8a2d6
Remove dedicated error for type checking
gmourier Mar 30, 2022
025cf66
Update text/0034-telemetry-policies.md
gmourier Mar 31, 2022
f2eab70
Bring naming changes
gmourier Mar 31, 2022
caf9ff2
Fix metrics name for typo_tolerance
gmourier Apr 13, 2022
d3d78d3
Update text/0034-telemetry-policies.md
gmourier Apr 22, 2022
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
132 changes: 132 additions & 0 deletions open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,42 @@ 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 for a search query.
type: array
items:
type: string
default: []
nullable: false
minWordSizeForTypos:
type: object
properties:
oneTypo:
description: Customize the minimum size for a word to tolerate 1 typo.
type: integer
default: 5
nullable: false
twoTypos:
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 @@ -458,6 +494,8 @@ components:
$ref: '#/components/schemas/searchableAttributes'
displayedAttributes:
$ref: '#/components/schemas/displayedAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
required:
- synonyms
- stopWords
Expand All @@ -466,6 +504,7 @@ components:
- distinctAttribute
- searchableAttributes
- displayedAttributes
- typoTolerance
stats:
type: object
additionalProperties: false
Expand Down Expand Up @@ -1607,6 +1646,8 @@ paths:
$ref: '#/components/schemas/filterableAttributes'
sortableAttributes:
$ref: '#/components/schemas/sortableAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
required:
- rankingRules
- distinctAttribute
Expand All @@ -1616,6 +1657,7 @@ paths:
- synonyms
- filterableAttributes
- sortableAttributes
- typoTolerance
examples:
Example:
value:
Expand Down Expand Up @@ -1657,6 +1699,16 @@ paths:
- price
- author
- title
typoTolerance:
enabled: true
disableOnAttributes:
- author
- price
disableOnWords:
- Tolkien
minWordSizeForTypos:
oneTypo: 4
twoTypos: 8
'401':
$ref: '#/components/responses/401'
'404':
Expand Down Expand Up @@ -1700,6 +1752,8 @@ paths:
$ref: '#/components/schemas/filterableAttributes'
sortableAttributes:
$ref: '#/components/schemas/sortableAttributes'
typoTolerance:
$ref: '#/components/schemas/typoTolerance'
examples:
Example:
value:
Expand Down Expand Up @@ -1736,6 +1790,16 @@ paths:
- release_date
filterableAttributes: []
sortableAttributes: null
typoTolerance:
enabled: false
disableOnAttributes:
- title
- author
disableOnWords:
- Tolkien
minWordSizeForTypos:
oneTypo: 4
twoTypos: 8
responses:
'202':
$ref: '#/components/responses/202'
Expand Down Expand Up @@ -2054,6 +2118,74 @@ paths:
description: Not Found
parameters:
- $ref: '#/components/parameters/indexUid'
'/indexes/{indexUid}/settings/typo-tolerance':
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 settings to the default configuration
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
27 changes: 25 additions & 2 deletions text/0034-telemetry-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
| RankingRules Updated | Occurs when ranking rules are updated via `POST` - `/indexes/:indexUid/settings/ranking-rules`. |
| FilterableAttributes Updated | Occurs when filterable attributes are updated via `POST` - `/indexes/:indexUid/settings/filterable-attributes`. |
| SortableAttributes Updated | Occurs when sortable attributes are updated via `POST` - `/indexes/:indexUid/settings/sortable-attributes`. |
| TypoTolerance Updated | Occurs when typo tolerance settings are updated via `POST` - `/indexes/:indexUid/settings/typo-tolerance`. |
| Dump Created | Occurs when a dump is created via `POST` - `/dumps`. |
| Tasks Seen | Occurs when tasks are fetched globally via `GET` - `/tasks`. |
| Index Tasks Seen | Occurs when tasks are filtered by index via `GET` - `/indexes/:indexUid/tasks`. |
Expand Down Expand Up @@ -116,7 +117,12 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
| `sortable_attributes.has_geo` | `true` if `_geo` is set as a sortable attribute, otherwise `false` | true | `Settings Updated`, `SortableAttributes Updated` |
| `filterable_attributes.total` | Number of filterable attributes | 3 | `Settings Updated`, `FilterableAttributes Updated` |
| `filterable_attributes.has_geo` | `true` if `_geo` is set as a filterable attribute, otherwise `false` | false | `Settings Updated`, `FilterableAttributes Updated`|
| `searchable_attributes.total` | Number of searchable attributes | 4 | `Settings Updated`, `SearchableAttributes Update` |
| `searchable_attributes.total` | Number of searchable attributes | 4 | `Settings Updated`, `SearchableAttributes Updated` |
| `typo_tolerance.enabled` | Whether the typo tolerance is enabled | `true` | `Settings Updated`, `TypoTolerance Updated` |
| `typo_tolerance.disable_on_attributes` | `true` if at least one value is defined | `false` | `Settings Updated`, `TypoTolerance Updated` |
| `typo_tolerance.disable_on_words` | `true` if at least one value is defined | `false` | `Settings Updated`, `TypoTolerance Updated` |
| `typo_tolerance.min_word_size_for_typos.one_typo` | The defined value for `minWordSizeForTypos.oneTypo` property | `5` | `Settings Updated`, `TypoTolerance Updated` |
| `typo_tolerance.min_word_size_for_typos.two_typos`| The defined value for `minWordSizeForTypos.twoTypos` property | `9` | `Settings Updated`, `TypoTolerance Updated` |
| `per_task_uid` | `true` if an uid is used to fetch a particular task resource, otherwise `false` | true | `Tasks Seen`, `Index Tasks Seen` |
|

Expand Down Expand Up @@ -275,12 +281,18 @@ This property allows us to gather essential information to better understand on
| Property name | Description | Example |
|---------------|-------------|---------|
| user_agent | Represents the user-agent encountered on this call. | `["Meilisearch Ruby (v2.1)", "Ruby (3.0)"]` |
| searchable_attributes.total | Number of searchable attributes. | `3`|
| ranking_rules.sort_position | Position of the `sort` ranking rule if any, otherwise `null`. | `5` |
| sortable_attributes.total | Number of sortable attributes. | `3` |
| sortable_attributes.has_geo | Indicate if `_geo` is set as a sortable attribute. | `false`|
| filterable_attributes.total | Number of filterable attributes. | `3` |
| filterable_attributes.has_geo | Indicate if `_geo` is set as a filterable attribute. | `false`|
| searchable_attributes.total | Number of searchable attributes. | `3`|
| typo_tolerance.enabled | Whether the typo tolerance is enabled. | `true` |
| typo_tolerance.disable_on_attributes | `true` if at least one value is defined for `disableOnAttributes` property. | `false` |
| typo_tolerance.disable_on_words | `true` if at least one value is defined for `disableOnWords` property. | `false` |
| typo_tolerance.min_word_size_for_typos.one_typo | The defined value for `minWordSizeForTypos.oneTypo` property. | `5` |
| typo_tolerance.min_word_size_for_typos.two_typos | The defined value for `minWordSizeForTypos.twoTypos` property. | `9` |

---

## `RankingRules Updated`
Expand Down Expand Up @@ -317,6 +329,17 @@ This property allows us to gather essential information to better understand on
| user_agent | Represents the user-agent encountered on this call. | `["Meilisearch Ruby (v2.1)", "Ruby (3.0)"]` |
| searchable_attributes.total | Number of searchable attributes. | `3` |


## `TypoTolerance Updated`

| Property name | Description | Example |
|---------------|-------------|---------|
| typo_tolerance.enabled | Whether the typo tolerance is enable.d | `true` |
| typo_tolerance.disable_on_attributes | `true` if at least one value is defined for `disableOnAttributes` property. | `false` |
| typo_tolerance.disable_on_words | `true` if at least one value is defined for `disableOnWords` property. | `false` |
| typo_tolerance.min_word_size_for_typos.one_typo | The defined value for `minWordSizeForTypos.oneTypo` property. | `5` |
| typo_tolerance.min_word_size_for_typos.two_typos | The defined value for `minWordSizeForTypos.twoTypos` property. | `9` |

## `Dump Created`

| Property name | Description | Example |
Expand Down
24 changes: 24 additions & 0 deletions text/0061-error-format-and-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,30 @@ HTTP Code: `400 Bad Request`

---

## invalid_typo_tolerance_min_word_size_for_typos

`Asynchronous`

### Context

This error happens when the `minWordSizeForTypos` object of the `typo` resource is invalid.

### Error Definition

```json
{
"message": "`minWordSizeForTypos` setting is invalid. `oneTypo` and `twoTypos` fields should be between `0` and `255`, and `twoTypos` should be greater or equals to `oneTypo` but found `oneTypo: :oneTypo` and twoTypos: twoTypos`.",
"code": "invalid_typo_tolerance_min_word_size_for_typos",
"type": "invalid_request",
"link": "https://docs.meilisearch.com/errors#invalid_typo_tolerance_min_word_size_for_typos"
}
```

- The `:oneTypo` is inferred when the message is generated.
- The `:twoTypos` is inferred when the message is generated.

---

## index_already_exists

`Asynchronous`
Expand Down
Loading