Skip to content

Commit 9488eb3

Browse files
authored
Merge 482ae66 into 736998a
2 parents 736998a + 482ae66 commit 9488eb3

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

generators/src/main/java/com/algolia/codegen/utils/OneOf.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,12 @@ private static void sortOneOfs(List<CodegenProperty> oneOfs) {
205205
List<?> discriminatorsA = (List<?>) propA.vendorExtensions.get("x-discriminator-fields");
206206
List<?> discriminatorsB = (List<?>) propB.vendorExtensions.get("x-discriminator-fields");
207207
return discriminatorsB.size() - discriminatorsA.size();
208-
} else {
209-
return 0;
208+
} else if (propA.isBoolean && !propB.isBoolean) {
209+
// put boolean last, because of typoTolerance
210+
return 1;
211+
} else if (!propA.isBoolean && propB.isBoolean) {
212+
return -1;
210213
}
214+
return 0;
211215
};
212216
}

specs/common/schemas/IndexSettings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ typoToleranceEnum:
929929
But if there are no matches without typos (with 1 typo), include matches with 1 typo (2 typos).
930930
- `strict`. Return matches with the two lowest numbers of typos.
931931
With `strict`, the Typo ranking criterion is applied first in the `ranking` setting.
932-
enum: [min, strict]
932+
enum: [min, strict, 'true', 'false']
933933

934934
ignorePlurals:
935935
description: |

tests/CTS/requests/search/getSettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"alternativesAsExact": [
3535
"ignorePlurals",
3636
"singleWordSynonym"
37-
]
37+
],
38+
"typoTolerance": "false"
3839
}
3940
}
4041
}

tests/CTS/requests/search/setSettings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
"parameters": {
55
"indexName": "cts_e2e_settings",
66
"indexSettings": {
7-
"paginationLimitedTo": 10
7+
"paginationLimitedTo": 10,
8+
"typoTolerance": "false"
89
},
910
"forwardToReplicas": true
1011
},
1112
"request": {
1213
"path": "/1/indexes/cts_e2e_settings/settings",
1314
"method": "PUT",
1415
"body": {
15-
"paginationLimitedTo": 10
16+
"paginationLimitedTo": 10,
17+
"typoTolerance": "false"
1618
},
1719
"queryParameters": {
1820
"forwardToReplicas": "true"

0 commit comments

Comments
 (0)