'Perform the search on the given query.
Boosts and numer of results are configurable in galaxy.ini file.
:param q: the query to search with
:type  q: str
:return:      Dictionary containing the tools\' ids of the best hits.
:return type: dict'

def _search(self, q):

    tool_name_boost = self.app.config.get('tool_name_boost', 9)
    tool_section_boost = self.app.config.get('tool_section_boost', 3)
    tool_description_boost = self.app.config.get('tool_description_boost', 2)
    tool_label_boost = self.app.config.get('tool_label_boost', 1)
    tool_stub_boost = self.app.config.get('tool_stub_boost', 5)
    tool_help_boost = self.app.config.get('tool_help_boost', 0.5)
    tool_search_limit = self.app.config.get('tool_search_limit', 20)
    tool_enable_ngram_search = self.app.config.get('tool_enable_ngram_search', False)
    tool_ngram_minsize = self.app.config.get('tool_ngram_minsize', 3)
    tool_ngram_maxsize = self.app.config.get('tool_ngram_maxsize', 4)
    results = self.app.toolbox_search.search(q=q, tool_name_boost=tool_name_boost, tool_section_boost=tool_section_boost, tool_description_boost=tool_description_boost, tool_label_boost=tool_label_boost, tool_stub_boost=tool_stub_boost, tool_help_boost=tool_help_boost, tool_search_limit=tool_search_limit, tool_enable_ngram_search=tool_enable_ngram_search, tool_ngram_minsize=tool_ngram_minsize, tool_ngram_maxsize=tool_ngram_maxsize)
    return results
