Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
fix: token search params were matching additional documents (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
carvantes authored Apr 28, 2021
1 parent aed310b commit 046238a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
4 changes: 0 additions & 4 deletions src/QueryBuilder/typeQueries/tokenQuery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ describe('tokenQuery', () => {
"identifier.code.keyword",
"identifier.coding.code.keyword",
"identifier.value.keyword",
"identifier.value",
"identifier",
],
"lenient": true,
Expand All @@ -121,7 +120,6 @@ describe('tokenQuery', () => {
"identifier.code.keyword",
"identifier.coding.code.keyword",
"identifier.value.keyword",
"identifier.value",
"identifier",
],
"lenient": true,
Expand All @@ -141,7 +139,6 @@ describe('tokenQuery', () => {
"identifier.code.keyword",
"identifier.coding.code.keyword",
"identifier.value.keyword",
"identifier.value",
"identifier",
],
"lenient": true,
Expand Down Expand Up @@ -183,7 +180,6 @@ describe('tokenQuery', () => {
"identifier.code.keyword",
"identifier.coding.code.keyword",
"identifier.value.keyword",
"identifier.value",
"identifier",
],
"lenient": true,
Expand Down
3 changes: 1 addition & 2 deletions src/QueryBuilder/typeQueries/tokenQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ export function tokenQuery(compiled: CompiledSearchParam, value: string): any {
const fields = [
`${compiled.path}.code.keyword`, // Coding
`${compiled.path}.coding.code.keyword`, // CodeableConcept
`${compiled.path}.value.keyword`, // Identifier
`${compiled.path}.value`, // ContactPoint
`${compiled.path}.value.keyword`, // Identifier, ContactPoint
`${compiled.path}`, // code, boolean, uri, string
];

Expand Down
11 changes: 0 additions & 11 deletions src/__snapshots__/elasticSearchService.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,6 @@ Array [
"id.code.keyword",
"id.coding.code.keyword",
"id.value.keyword",
"id.value",
"id",
],
"lenient": true,
Expand All @@ -1437,7 +1436,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand Down Expand Up @@ -1553,7 +1551,6 @@ Array [
"id.code.keyword",
"id.coding.code.keyword",
"id.value.keyword",
"id.value",
"id",
],
"lenient": true,
Expand Down Expand Up @@ -1593,7 +1590,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand Down Expand Up @@ -1653,7 +1649,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand All @@ -1679,7 +1674,6 @@ Array [
"identifier.code.keyword",
"identifier.coding.code.keyword",
"identifier.value.keyword",
"identifier.value",
"identifier",
],
"lenient": true,
Expand Down Expand Up @@ -1722,7 +1716,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand Down Expand Up @@ -1772,7 +1765,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand Down Expand Up @@ -1852,7 +1844,6 @@ Array [
"id.code.keyword",
"id.coding.code.keyword",
"id.value.keyword",
"id.value",
"id",
],
"lenient": true,
Expand All @@ -1865,7 +1856,6 @@ Array [
"gender.code.keyword",
"gender.coding.code.keyword",
"gender.value.keyword",
"gender.value",
"gender",
],
"lenient": true,
Expand Down Expand Up @@ -1991,7 +1981,6 @@ Array [
"telecom.code.keyword",
"telecom.coding.code.keyword",
"telecom.value.keyword",
"telecom.value",
"telecom",
],
"lenient": true,
Expand Down

0 comments on commit 046238a

Please sign in to comment.