Skip to content

Commit

Permalink
fix: OR-2058 reverse condition on duplicate detection for IsDeleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lesage committed Jan 18, 2024
1 parent 82528b5 commit 987a201
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ await _client
q => q.Bool(
b => b.Must(
MatchOpNaam(naam),
IsNietGestopt,
IsNietVerwijderd
IsNietGestopt
)
.MustNot(BeVerwijderd)
.Filter(MatchOpPostcodeOfGemeente(gemeentes, postcodes)
)
)
Expand Down Expand Up @@ -71,10 +71,13 @@ private static QueryContainer IsNietGestopt(QueryContainerDescriptor<DuplicateDe
.Value(false));
}

private static QueryContainer IsNietVerwijderd(QueryContainerDescriptor<DuplicateDetectionDocument> descriptor)
private static QueryContainer BeVerwijderd(QueryContainerDescriptor<DuplicateDetectionDocument> shouldDescriptor)
{
return descriptor.Term(queryDescriptor => queryDescriptor.Field(document => document.IsVerwijderd)
.Value(false));
return shouldDescriptor
.Term(termDescriptor
=> termDescriptor
.Field(document => document.IsVerwijderd)
.Value(true));
}

private static Func<QueryContainerDescriptor<DuplicateDetectionDocument>, QueryContainer> MatchOpPostcode(string[] postcodes)
Expand Down

0 comments on commit 987a201

Please sign in to comment.