From c0ee3564720dfe9fcd4e97aaaeacc37094ec2f67 Mon Sep 17 00:00:00 2001 From: Guillaume Mourier Date: Wed, 2 Mar 2022 10:11:01 +0100 Subject: [PATCH] Remove typoTolerance properties at search time --- open-api.yaml | 27 ---------------------- text/0117-typo-tolerance-api.md | 40 +++++++++++++-------------------- text/0118-search-api.md | 13 ----------- 3 files changed, 15 insertions(+), 65 deletions(-) diff --git a/open-api.yaml b/open-api.yaml index 079b1e5d9..0e8090297 100644 --- a/open-api.yaml +++ b/open-api.yaml @@ -779,26 +779,6 @@ components: > warn > Attribute(s) used in `filter` should be declared as filterable attributes. See [Filtering and Faceted Search](https://docs.meilisearch.com/reference/features/filtering_and_faceted_search.html). - typoTolerance.enabled: - name: typoTolerance.enabled - in: query - required: false - typoTolerance.disableOnAttributes: - name: typoTolerance.disableOnAttributes - in: query - required: false - typoTolerance.disableOnWords: - name: typoTolerance.disableOnWords - in: query - required: false - typoTolerance.minWordSizeFor1Typo: - name: typoTolerance.minWordSizeFor1Typo - in: query - required: false - typoTolerance.minWordSizeFor2Typos: - name: typoTolerance.minWordSizeFor2Typos - in: query - required: false Content-Type: name: Content-Type in: header @@ -1451,11 +1431,6 @@ paths: - $ref: '#/components/parameters/sort' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/matches' - - $ref: '#/components/parameters/typoTolerance.enabled' - - $ref: '#/components/parameters/typoTolerance.disableOnAttributes' - - $ref: '#/components/parameters/typoTolerance.disableOnWords' - - $ref: '#/components/parameters/typoTolerance.minWordSizeFor1Typo' - - $ref: '#/components/parameters/typoTolerance.minWordSizeFor2Typos' responses: '200': description: Ok @@ -1566,8 +1541,6 @@ paths: default: 20 sort: $ref: '#/components/schemas/sort' - typoTolerance: - $ref: '#/components/schemas/typoTolerance' examples: Example: value: diff --git a/text/0117-typo-tolerance-api.md b/text/0117-typo-tolerance-api.md index 26d73a8a6..68fe3aad3 100644 --- a/text/0117-typo-tolerance-api.md +++ b/text/0117-typo-tolerance-api.md @@ -5,7 +5,7 @@ ## 1. Summary -This specification describes the configuration options for the typo tolerance feature, both as settings for an index being overridable at search time. +This specification describes the customizable options for the typo tolerance settings. ## 2. Motivation @@ -17,20 +17,19 @@ Meilisearch can adapt to different use-cases with specific requirements by provi ### 3.1. `typoTolerance` API resource definition -| Field | Type | Required | -|----------------------|-----------------|----------------------------------| -| enabled | Boolean | True (Settings) - False (Search) | -| disableOnAttributes | Array of String | True (Settings) - False (Search) | -| disableOnWords | Array of String | True (Settings) - False (Search) | -| minWordSizeFor1Typo | Integer | True (Settings) - False (Search) | -| minWordSizeFor2Typos | Integer | True (Settings) - False (Search) | +| Field | Type | Required | +|----------------------|-----------------|----------| +| enabled | Boolean | True | +| disableOnAttributes | Array of String | True | +| disableOnWords | Array of String | True | +| minWordSizeFor1Typo | Integer | True | +| minWordSizeFor2Typos | Integer | True | -> Every field of typoTolerance object is mandatory when specified as an index setting. When a property of this setting is overridden during the search time, other resource properties are not required. #### 3.1.1. `enabled` - Type: Boolean -- Required: True (Settings) - False (Search) +- Required: True - Default: `true` Whether the typo tolerance feature is enabled. @@ -42,7 +41,7 @@ If the `rankingRules` parameter of the index settings does not contain the `typo ### 3.1.2. `disableOnAttributes` - Type: Array of String -- Required: True (Settings) - False (Search) +- Required: True - Default: `[]` `disableOnAttributes` disable the typo tolerance feature on the specified attributes set. @@ -53,7 +52,7 @@ If the `rankingRules` parameter of the index settings does not contain the `typo ### 3.1.3. `disableOnWords` - Type: Array of String -- Required: True (Settings) - False (Search) +- Required: True - Default: `[]` `disableOnWords` disable the typo tolerance feature for a set of search query terms. @@ -63,7 +62,7 @@ If the `rankingRules` parameter of the index settings does not contain the `typo ### 3.1.4. `minWordSizeFor1Typo` - Type: Integer -- Required: True (Settings) - False (Search) +- Required: True - Default: `5` `minWordSizeFor1Typo` customize the minimum size for a word to tolerate 1 typo. @@ -73,7 +72,7 @@ If the `rankingRules` parameter of the index settings does not contain the `typo ### 3.1.5. `minWordSizeFor2Typos` - Type: Integer -- Required: True (Settings) - False (Search) +- Required: True - Default: `9` `minWordSizeFor2Typos` customize the minimum size for a word to tolerate 2 typos. @@ -86,8 +85,6 @@ If the `rankingRules` parameter of the index settings does not contain the `typo Manage the typo tolerance configuration for an index. -> This configuration can be overridden at search time. See 3.4.1 `indexes/:index_uid/search` section. - #### 3.2.1.1 `GET` - `indexes/:index_uid/settings/typo-tolerance` Allow fetching the current definition of the typo tolerance feature for an index. @@ -158,7 +155,7 @@ Request payload #### 3.2.1.3 `DELETE`- `indexes/:index_uid/settings/typo-tolerance` -Allow resetting the default settings of the typo tolerance feature for an index. +Allow resetting the typo tolerance feature to the default for an index. > Returns a 202 response. See [Tasks API](0060-tasks-api.md) @@ -172,17 +169,10 @@ Allow resetting the default settings of the typo tolerance feature for an index. > See [Settings API] -### 3.4.1 `indexes/:index_uid/search` - -The typo tolerance resource is exposed on the search endpoints. It lets users build a search experience fastly by testing different configurations while editing the frontend. Thus, defining specific typo tolerance settings at search can be helpful when diverse audiences search in the same index from different clients. - -If defined for a search query, a `typoTolerance` property overrides its value defined in the `typoTolerance` index settings. - -> See [Search API](0118-search-api.md) - ## 2. Technical Details tbd ## 3. Future Possibilities +- Expose `typoTolerance` properties at search time. - Add the possibility to disable typo-tolerance on all numeric fields. - Add different modes of result matching for the typo-tolerance feature. e.g. `default`/`min`/`strict` \ No newline at end of file diff --git a/text/0118-search-api.md b/text/0118-search-api.md index 0c194069a..3150193aa 100644 --- a/text/0118-search-api.md +++ b/text/0118-search-api.md @@ -46,7 +46,6 @@ If the instance is secured by a master-key, the auth layer returns the following | attributesToCrop | Array of String - String | False | | cropLength | Integer | False | | matches | Boolean | False | -| typoTolerance | Object[typoTolerance] | False | ##### 1.2.1.1 `q` @@ -208,18 +207,6 @@ Adds a `_matchesInfo` object to the search response that contains the location o - 🔴 Sending a value with a different type than `Boolean` or `null` for `matches` returns a [bad_request](0061-error-format-and-definitions.md#bad_request) error. -##### 1.2.1.12 `typoTolerance` - -- Type: Object[typoTolerance] -- Required: False -- Default: `null` - -Override typo tolerance settings at search time. - -The attributes of the `typoTolerance` object are not mandatory at search time. - -> See [Typo Tolerance](0117-typo-tolerance-api.md) - #### 1.2.2. Search response | Field | Type | Required |