diff --git a/deployment/docker/.env.example b/deployment/docker/.env.example index 785272b..8ec6480 100644 --- a/deployment/docker/.env.example +++ b/deployment/docker/.env.example @@ -48,6 +48,8 @@ UDP_TRACKERS_ENABLED=true CONSUMER_REPLICAS=3 ## Fix for #66 - toggle on for development AUTO_CREATE_AND_APPLY_MIGRATIONS=false +## Allows control of the threshold for matching titles to the IMDB dataset. The closer to 0, the more strict the matching. +TITLE_MATCH_THRESHOLD=0.25 # Producer GITHUB_PAT= diff --git a/src/node/consumer/src/lib/models/configuration/metadata_config.ts b/src/node/consumer/src/lib/models/configuration/metadata_config.ts index 32b4e33..d728c10 100644 --- a/src/node/consumer/src/lib/models/configuration/metadata_config.ts +++ b/src/node/consumer/src/lib/models/configuration/metadata_config.ts @@ -1,4 +1,5 @@ export const metadataConfig = { IMDB_CONCURRENT: parseInt(process.env.IMDB_CONCURRENT || "1", 10), - IMDB_INTERVAL_MS: parseInt(process.env.IMDB_INTERVAL_MS || "1000", 10) + IMDB_INTERVAL_MS: parseInt(process.env.IMDB_INTERVAL_MS || "1000", 10), + TITLE_MATCH_THRESHOLD: Number(process.env.TITLE_MATCH_THRESHOLD || 0.25), }; \ No newline at end of file diff --git a/src/node/consumer/src/lib/mongo/mongo_repository.ts b/src/node/consumer/src/lib/mongo/mongo_repository.ts index ad55f11..82e7db1 100644 --- a/src/node/consumer/src/lib/mongo/mongo_repository.ts +++ b/src/node/consumer/src/lib/mongo/mongo_repository.ts @@ -13,7 +13,7 @@ import mongoose from 'mongoose'; const fuseOptions : IFuseOptions = { includeScore: true, keys: ['PrimaryTitle', 'OriginalTitle'], - threshold: 0.25, + threshold: configurationService.metadataConfig.TITLE_MATCH_THRESHOLD, }; @injectable()