From 6a716f10f33e0a4fa906b5f90327585db37c45d1 Mon Sep 17 00:00:00 2001 From: henrietteharmse Date: Thu, 23 Nov 2023 17:14:47 +0000 Subject: [PATCH] Change for #590 to get Zooma working. --- .../ebi/spot/ols/controller/api/v1/V1SearchController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/uk/ac/ebi/spot/ols/controller/api/v1/V1SearchController.java b/backend/src/main/java/uk/ac/ebi/spot/ols/controller/api/v1/V1SearchController.java index 82c279bca..ca6d2fdaa 100644 --- a/backend/src/main/java/uk/ac/ebi/spot/ols/controller/api/v1/V1SearchController.java +++ b/backend/src/main/java/uk/ac/ebi/spot/ols/controller/api/v1/V1SearchController.java @@ -108,7 +108,10 @@ public void search( } } - solrQuery.setFields("_json"); + if (fieldList.contains("score")) + solrQuery.setFields("_json","score"); + else + solrQuery.setFields("_json"); if (ontologies != null && !ontologies.isEmpty()) { @@ -233,6 +236,8 @@ public void search( if (fieldList.contains("synonym")) outDoc.put("synonym", JsonHelper.getStrings(json, "synonym")); if (fieldList.contains("ontology_prefix")) outDoc.put("ontology_prefix", JsonHelper.getString(json, "ontologyPreferredPrefix")); if (fieldList.contains("subset")) outDoc.put("subset", JsonHelper.getStrings(json, "http://www.geneontology.org/formats/oboInOwl#inSubset")); + if (fieldList.contains("ontology_iri")) outDoc.put("ontology_iri", JsonHelper.getStrings(json, "ontologyIri").get(0)); + if (fieldList.contains("score")) outDoc.put("score", res.get("score")); // Include annotations that were specified with _annotation boolean anyAnnotations = fieldList.stream()