Skip to content

fix(specs): typoTolerance can be a boolean string #4900

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 2 commits into from
Jun 2, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ private static void sortOneOfs(List<CodegenProperty> oneOfs) {
List<?> discriminatorsA = (List<?>) propA.vendorExtensions.get("x-discriminator-fields");
List<?> discriminatorsB = (List<?>) propB.vendorExtensions.get("x-discriminator-fields");
return discriminatorsB.size() - discriminatorsA.size();
} else {
return 0;
} else if (propA.isBoolean && !propB.isBoolean) {
// put boolean last, because of typoTolerance
return 1;
} else if (!propA.isBoolean && propB.isBoolean) {
return -1;
}
return 0;
};
}
2 changes: 1 addition & 1 deletion specs/common/schemas/IndexSettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ typoToleranceEnum:
But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos).
- `strict`. Return matches with the two lowest numbers of typos.
With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
enum: [min, strict]
enum: [min, strict, 'true', 'false']

ignorePlurals:
description: |
Expand Down
3 changes: 2 additions & 1 deletion tests/CTS/requests/search/getSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"alternativesAsExact": [
"ignorePlurals",
"singleWordSynonym"
]
],
"typoTolerance": "false"
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions tests/CTS/requests/search/setSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"parameters": {
"indexName": "cts_e2e_settings",
"indexSettings": {
"paginationLimitedTo": 10
"paginationLimitedTo": 10,
"typoTolerance": "false"
},
"forwardToReplicas": true
},
"request": {
"path": "/1/indexes/cts_e2e_settings/settings",
"method": "PUT",
"body": {
"paginationLimitedTo": 10
"paginationLimitedTo": 10,
"typoTolerance": "false"
},
"queryParameters": {
"forwardToReplicas": "true"
Expand Down