Skip to content

fix(specs): correct type for typoTolerance #722

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 1 commit into from
Jun 20, 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
17 changes: 11 additions & 6 deletions specs/common/schemas/IndexSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,6 @@ userData:
description: Lets you store custom data in your indices.
default: {}

typoTolerance:
type: string
enum: [true, false, min, strict]
description: Controls whether typo tolerance is enabled and how it is applied.
default: true

queryType:
type: string
enum: [prefixLast, prefixAll, prefixNone]
Expand All @@ -320,6 +314,17 @@ advancedSyntaxFeatures:
type: string
enum: [exactPhrase, excludeWords]

typoTolerance:
description: Controls whether typo tolerance is enabled and how it is applied.
oneOf:
- type: boolean
default: true
- $ref: '#/typoToleranceEnum'

typoToleranceEnum:
type: string
enum: [min, strict]

ignorePlurals:
description: >
Treats singular, plurals, and other forms of declensions as matching terms.
Expand Down
2 changes: 1 addition & 1 deletion templates/javascript/tests/requests/requests.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const client = {{client}}(appId, apiKey, {{#hasRegionalHost}}'{{{defaultRegion}}
{{#blocksRequests}}
describe('{{operationId}}', () => {
{{#tests}}
test('{{testName}}', async () => {
test('{{{testName}}}', async () => {
{{#hasRequestOptions}}const requestOptions: RequestOptions = {
{{#requestOptions.queryParameters.parameters}}queryParameters: {{{.}}},{{/requestOptions.queryParameters.parameters}}
{{#requestOptions.headers.parameters}}headers: {{{.}}}{{/requestOptions.headers.parameters}}
Expand Down
41 changes: 41 additions & 0 deletions tests/CTS/methods/requests/search/setSettings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
{
"testName": "setSettings with minimal parameters",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
Expand All @@ -17,5 +18,45 @@
"forwardToReplicas": "true"
}
}
},
{
"testName": "setSettings allow boolean `typoTolerance`",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
"typoTolerance": true
},
"forwardToReplicas": true
},
"request": {
"path": "/1/indexes/theIndexName/settings",
"method": "PUT",
"body": {
"typoTolerance": true
},
"queryParameters": {
"forwardToReplicas": "true"
}
}
},
{
"testName": "setSettings allow enum `typoTolerance`",
"parameters": {
"indexName": "theIndexName",
"indexSettings": {
"typoTolerance": "min"
},
"forwardToReplicas": true
},
"request": {
"path": "/1/indexes/theIndexName/settings",
"method": "PUT",
"body": {
"typoTolerance": "min"
},
"queryParameters": {
"forwardToReplicas": "true"
}
}
}
]