Skip to content

Commit

Permalink
chore(elastic-upgrade): remove accidental nesting of must bools
Browse files Browse the repository at this point in the history
  • Loading branch information
makelicious committed Jul 30, 2024
1 parent f9cdd6f commit 82a672b
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions packages/search/src/features/registration/deduplicate/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,25 @@ export const searchForBirthDuplicates = async (

const childsNameMatch = {
bool: {
must: {
bool: {
must: [
body.childFirstNames && {
match: {
childFirstNames: {
query: body.childFirstNames,
fuzziness: FIRST_NAME_FUZZINESS
}
}
},
body.childFamilyName && {
match: {
childFamilyName: {
query: body.childFamilyName,
fuzziness: FIRST_NAME_FUZZINESS,
minimum_should_match: '100%'
}
}
must: [
body.childFirstNames && {
match: {
childFirstNames: {
query: body.childFirstNames,
fuzziness: FIRST_NAME_FUZZINESS
}
}
},
body.childFamilyName && {
match: {
childFamilyName: {
query: body.childFamilyName,
fuzziness: FIRST_NAME_FUZZINESS,
minimum_should_match: '100%'
}
].filter(isNonEmptyCondition)
}
}
}
].filter(isNonEmptyCondition)
}
}

Expand Down

0 comments on commit 82a672b

Please sign in to comment.