Skip to content

Commit

Permalink
fix: ES missing number value filter query
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjiequan committed May 28, 2024
1 parent b287025 commit 9e2c03c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/elastic-search/configuration/datasetFieldMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ export const datasetMappings: MappingObject = {
type: "keyword",
ignore_above: 256,
},
size: {
type: "long",
},
};
4 changes: 2 additions & 2 deletions src/elastic-search/providers/query-builder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ export class SearchQueryService {
},
});
}
if (typeof values === "string") {
if (typeof values === "string" || typeof values === "number") {
filterArray.push({
match: {
[fieldName]: values as string,
[fieldName]: values as string | number,
},
});
}
Expand Down

0 comments on commit 9e2c03c

Please sign in to comment.