From ef838655454048551c894f2f84534bb2d6f40b78 Mon Sep 17 00:00:00 2001 From: khaledk2 Date: Fri, 29 Nov 2024 11:57:39 +0000 Subject: [PATCH] unify data_source keyword, and return organism for images --- .../api/v1/resources/resource_analyser.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/omero_search_engine/api/v1/resources/resource_analyser.py b/omero_search_engine/api/v1/resources/resource_analyser.py index 1e29e21..dfd7ec8 100644 --- a/omero_search_engine/api/v1/resources/resource_analyser.py +++ b/omero_search_engine/api/v1/resources/resource_analyser.py @@ -335,18 +335,20 @@ def prepare_search_results(results, size=0): for hit in results["hits"]["hits"]: res = hit["_source"] resource = res.get("resource") - # ignore organism key in the results + # ignore + # key in the results # please see (https://github.com/ome/omero_search_engine/issues/45) + # # This will be checked later. - if ( - resource == "image" - and res["Attribute"] - and res["Attribute"].lower() == "organism" - ): - continue + # if ( + # resource == "image" + # and res["Attribute"] + # and res["Attribute"].lower() == "organism" + # ): + # continue row = {} returned_results.append(row) - row["Data Source"] = res["data_source"] + row["data_source"] = res["data_source"] row["Key"] = res["Attribute"] row["Value"] = res["Value"] row["Number of %ss" % resource] = res.get("items_in_the_bucket")