renaming search to query_search and optimizing ger_d