diff --git a/src/dug/core/async_search.py b/src/dug/core/async_search.py index 1414c78..35ee14c 100644 --- a/src/dug/core/async_search.py +++ b/src/dug/core/async_search.py @@ -466,7 +466,6 @@ async def search_program(self, program_name=None, offset=0, size=None): """ Search for studies by unique_id (ID or name) and/or study_name. """ - # Initialize the query_body with the outer structure query_body = { "query": { @@ -504,10 +503,7 @@ async def search_program(self, program_name=None, offset=0, size=None): # Prepare the query body for execution body = query_body - print(body) - - # Execute the search query - + # Execute the search query search_results = await self.es.search( index="variables_index", @@ -527,10 +523,6 @@ async def search_program(self, program_name=None, offset=0, size=None): # Append the details to the list in the desired format collection_details_list.append(collection_details) - # Print the list of collection details in JSON format - import json - #print(json.dumps(collection_details_list, indent=4)) - return collection_details_list @@ -559,15 +551,12 @@ async def search_program_list(self): index="variables_index", body=query_body ) - # The unique data_types and their counts of unique collection_ids will be in the 'aggregations' field of the response unique_data_types = search_results['aggregations']['unique_program_names']['buckets'] - # Testing the output so print the unique data_types and their counts of unique collection_ids - #for bucket in unique_data_types: - # print(f"data_type: {bucket['key']}, count of unique collection_ids: {bucket['No_of_studies']['value']}") - return unique_data_types + + def _get_var_query(self, concept, fuzziness, prefix_length, query): """Returns ES query for variable search""" es_query = {