diff --git a/gem5.config.json b/gem5.config.json index ba06b1d..7e0df1f 100644 --- a/gem5.config.json +++ b/gem5.config.json @@ -121,5 +121,6 @@ "metadata": {} } } - } + }, + "gem5_version": "24.0" } \ No newline at end of file diff --git a/next.config.js b/next.config.js index c6288df..b76e764 100644 --- a/next.config.js +++ b/next.config.js @@ -26,6 +26,7 @@ module.exports = { BASE_PATH: basePath, SOURCES: config.config.sources, TABS: config.ui.tabs, + GEM5_VERSION: config.gem5_version }, webpack: (config) => { config.module.rules.push({ diff --git a/pages/api/mongodb/getResourcesByQuery.js b/pages/api/mongodb/getResourcesByQuery.js index ae2a0e6..4045658 100644 --- a/pages/api/mongodb/getResourcesByQuery.js +++ b/pages/api/mongodb/getResourcesByQuery.js @@ -111,6 +111,9 @@ function getLatestVersionPipeline() { * @returns {Array} - An array representing the MongoDB aggregation pipeline to perform text search. */ function getSearchPipeline(queryObject) { + // getting current gem5_version to boost search for resources compatible with latest gem5 release + const gem5_version = process.env.GEM5_VERSION; + let pipeline = [ { $search: { @@ -127,6 +130,17 @@ function getSearchPipeline(queryObject) { }, }, }, + { + text: { + path: "gem5_versions", + query: gem5_version, + score: { + boost: { + value: 10, + }, + }, + }, + } ], must: [ {