Skip to content

Commit

Permalink
Fix issue of getting containers names with data source
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledk2 committed Nov 4, 2024
1 parent a7b72cf commit 8d4d895
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions omero_search_engine/api/v1/resources/resource_analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ def get_the_results(
hits = results_["hits"]["hits"]
if len(hits) > 0:
for hit in hits:
if "resourcename" not in hit["_source"]:
continue
if len(hits) > 0:
if name and not description:
returned_results[hit["_source"]["data_source"]] = [
Expand All @@ -871,18 +873,16 @@ def get_the_results(
and name.lower() in item.get("description").lower()
)
]
elif "resourcename" in hit["_source"]:
else:
returned_results[hit["_source"]["data_source"]] = [
item for item in hit["_source"]["resourcename"]
]
else:
return returned_results

# remove container description from the results,
# should be added again later after cleaning up the description

for k, item in returned_results.items():
del item[0]["description"]
if len(item) > 0:
del item[0]["description"]
return returned_results


Expand Down

0 comments on commit 8d4d895

Please sign in to comment.