diff --git a/src/dug/core/search.py b/src/dug/core/search.py index 6148f212..f5c83b2a 100644 --- a/src/dug/core/search.py +++ b/src/dug/core/search.py @@ -411,13 +411,13 @@ def search_variables(self, index, concept="", query="", size=None, data_type=Non "identifiers": concept } } - + body = json.dumps({'query': query}) total_items = self.es.count(body=body, index=index) search_results = self.es.search( index=index, body=body, - filter_path=['hits.hits._id', 'hits.hits._type', 'hits.hits._source'], + filter_path=['hits.hits._id', 'hits.hits._type', 'hits.hits._source', 'hits.hits._score'], from_=offset, size=size ) @@ -441,7 +441,8 @@ def search_variables(self, index, concept="", query="", size=None, data_type=Non "description": elem_s['element_desc'], "e_link": elem_s['element_action'], "id": elem_id, - "name": elem_s['element_name'] + "name": elem_s['element_name'], + "score": round(elem['_score'], 6) } # Case: collection not in dictionary for given data_type