Merge remote-tracking branch 'origin/new-search-json' into beta18

This commit is contained in:
Konstantina Galouni 2025-01-08 11:49:02 +02:00
commit 63839345d6
5 changed files with 10 additions and 6 deletions

View File

@ -10,3 +10,4 @@ max.size = 200
# file size in KB
big-max.size = 1000
port = 8000
environment = beta

View File

@ -10,5 +10,5 @@ max.size = 200
# file size in KB
big-max.size = 1000
port = 8000
environment = development

View File

@ -10,3 +10,4 @@ max.size = 200
# file size in KB
big-max.size = 1000
port = 8000
environment = production

View File

@ -1,5 +1,5 @@
userInfoUrl = http://dl170.madgik.di.uoa.gr:19080/login-service/userInfo
searchServiceAPIUrl = https://beta.services.openaire.eu/search/v2/api/
searchServiceAPIUrl = https://services.openaire.eu/search/v2/api/
monitorAPIUrl = http://dl170.madgik.di.uoa.gr:19380/uoa-monitor-service/
irishMonitorAPIUrl = http://dl170.madgik.di.uoa.gr:19680/irish-monitor-service/
fundersServiceAPIUrl = https://dev-openaire.d4science.org/openaire/funders/
@ -10,3 +10,4 @@ max.size = 200
# file size in KB
big-max.size = 1000
port = 8000
environment = development

View File

@ -104,12 +104,13 @@ app.delete(['/delete/:filename', '/delete/stakeholder/:filename', '/delete/:type
app.get('/explore/home', async function (req, res) {
try {
// Make requests to multiple APIs
let openOrgsId = properties.get('environment') != "production" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : "";
// Make requests to multiple APIs
let requests= [
"http://localhost:" + properties.get('port') + "/portals/countResults",
searchServiceAPIUrl +'results/?fields=relfunder&sf=relfunder&format=json&size=0',
searchServiceAPIUrl + 'datasources/count?format=json',
searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)',
searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* or reldatasourcecompatibilityid = native'+(openOrgsId ? (' or collectedfromdatasourceid="'+openOrgsId+'"') : "")+')',
searchServiceAPIUrl + 'projects/?fields=funder&sf=funder&format=json&size=0',
searchServiceAPIUrl + 'resources?query=(%20(oaftype%20exact%20result)%20and%20(resulttypeid%20exact%20dataset)%20and%20(relresulttype%3Dpublication)%20%20)&page=0&size=0&format=json',
searchServiceAPIUrl + 'resources?query=(%20(oaftype%20exact%20result)%20and%20(resulttypeid%20exact%20software)%20and%20(relresulttype%3Dpublication)%20%20)&page=0&size=0&format=json'
@ -146,11 +147,11 @@ app.get('/explore/home', async function (req, res) {
app.get('/explore/search', async function (req, res) {
let aggregatedData = {};
try {
// Make requests to multiple APIs
let openOrgsId = properties.get('environment') != "production" ? 'openaire____%3A%3A0362fcdb3076765d9c0041ad331553e8' : ""; // Make requests to multiple APIs
let requests= [
searchServiceAPIUrl +'resources2/?format=json&size=0&type=results',
searchServiceAPIUrl + 'datasources/count?format=json',
searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)',
searchServiceAPIUrl + 'resources2/?format=json&size=0&type=organizations&fq=(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* or reldatasourcecompatibilityid = native' + (openOrgsId ? (' or collectedfromdatasourceid="'+openOrgsId+'"') : "") +')',
searchServiceAPIUrl + 'projects/count?format=json&fq=projectcode<>"unidentified"'
]
const dataPromises = requests.map((url) => axios.get( url));