Skip to content

Commit

Permalink
refactor: better math
Browse files Browse the repository at this point in the history
  • Loading branch information
GPaoloni committed Sep 26, 2024
1 parent d9f44c5 commit 151404c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const BOOST_FACTORS = {
case: 3,
};
const MIN_SCORE = 0.1;
const MAX_INT = 2147483648; // 2^31, the max integer allowed by ElasticSearch integer type
const MAX_INT = 2147483648 - 1; // 2^31 - 1, the max integer allowed by ElasticSearch integer type

export const FILTER_ALL_CLAUSE: QueryDslQueryContainer[][] = [
[
Expand Down Expand Up @@ -205,7 +205,7 @@ const generateQueriesFromId = <TDoc extends DocumentType>({
const parsed = Number.parseInt(term, 10);

// Ignore numbers that are greater than maximum supported int
if (parsed >= MAX_INT) {
if (parsed > MAX_INT) {
return null;
}

Expand Down

0 comments on commit 151404c

Please sign in to comment.