Skip to content

Commit 74d2af1

Browse files
committed
RLPNC-7516: Removed default value for scoreIfNull
1 parent f4fb270 commit 74d2af1

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

json/src/test/java/com/basistech/rosette/apimodel/RecordSimilarityRequestTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RecordSimilarityRequestTest {
4242

4343
private static final ObjectMapper MAPPER = ApiModelMixinModule.setupObjectMapper(new ObjectMapper());
4444

45-
private static final String EXPECTED_JSON = "{\"fields\":{\"addr\":{\"type\":\"rni_address\",\"weight\":0.5,\"scoreIfNull\":-1.0},\"dob\":{\"type\":\"rni_date\",\"weight\":0.2,\"scoreIfNull\":-1.0},\"primaryName\":{\"type\":\"rni_name\",\"weight\":0.5,\"scoreIfNull\":-1.0},\"dob2\":{\"type\":\"rni_date\",\"weight\":0.1,\"scoreIfNull\":-1.0}},\"properties\":{\"threshold\":0.7,\"includeExplainInfo\":true},\"records\":{\"left\":[{\"addr\":\"123 Roadlane Ave\",\"dob\":\"1993-04-16\",\"primaryName\":{\"text\":\"Ethan R\",\"entityType\":\"PERSON\",\"language\":\"eng\",\"languageOfOrigin\":\"eng\",\"script\":\"Latn\"},\"dob2\":{\"date\":\"1993/04/16\"}},{\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":{\"text\":\"Evan R\"}}],\"right\":[{\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":{\"text\":\"Seth R\",\"language\":\"eng\"}},{\"addr\":{\"address\":\"123 Roadlane Ave\"},\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":\"Ivan R\",\"dob2\":{\"date\":\"1993/04/16\"}}]}}";
45+
private static final String EXPECTED_JSON = "{\"fields\":{\"addr\":{\"type\":\"rni_address\",\"weight\":0.5,\"scoreIfNull\":null},\"dob\":{\"type\":\"rni_date\",\"weight\":0.2,\"scoreIfNull\":null},\"primaryName\":{\"type\":\"rni_name\",\"weight\":0.5,\"scoreIfNull\":null},\"dob2\":{\"type\":\"rni_date\",\"weight\":0.1,\"scoreIfNull\":null}},\"properties\":{\"threshold\":0.7,\"includeExplainInfo\":true},\"records\":{\"left\":[{\"addr\":\"123 Roadlane Ave\",\"dob\":\"1993-04-16\",\"primaryName\":{\"text\":\"Ethan R\",\"entityType\":\"PERSON\",\"language\":\"eng\",\"languageOfOrigin\":\"eng\",\"script\":\"Latn\"},\"dob2\":{\"date\":\"1993/04/16\"}},{\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":{\"text\":\"Evan R\"}}],\"right\":[{\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":{\"text\":\"Seth R\",\"language\":\"eng\"}},{\"addr\":{\"address\":\"123 Roadlane Ave\"},\"dob\":{\"date\":\"1993-04-16\"},\"primaryName\":\"Ivan R\",\"dob2\":{\"date\":\"1993/04/16\"}}]}}";
4646
private static final RecordSimilarityRequest EXPECTED_REQUEST = RecordSimilarityRequest.builder()
4747
.fields(Map.of(
4848
"primaryName", RecordSimilarityFieldInfo.builder().type(RecordFieldType.NAME).weight(0.5).build(),

model/src/main/java/com/basistech/rosette/apimodel/recordsimilarity/RecordSimilarityFieldInfo.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@
2929
@Builder
3030
@Value
3131
public class RecordSimilarityFieldInfo {
32-
// The default setting for scoreIfNull, which disables this feature
33-
private static final double DEFAULT_SCORE_IF_NULL = -1.0;
3432
@NotNull @Valid RecordFieldType type;
3533
Double weight;
3634
/**
3735
* the score that this field should return if the field is null in a record
3836
*/
39-
@Builder.Default
40-
@NotNull @Valid Double scoreIfNull = DEFAULT_SCORE_IF_NULL;
37+
@NotNull @Valid Double scoreIfNull;
4138
}

0 commit comments

Comments
 (0)