<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def search_index_advanced(self, index, query):
        '''
        Advanced search query against an entire index

        > query = ElasticQuery().query_string(query='imchi')
        > search = ElasticSearch()
        '''
        request = self.session
        url = 'http://%s:%s/%s/_search' % (self.host, self.port, index)
        if self.params:
            content = dict(query=query, **self.params)
        else:
            content = dict(query=query)
        if self.verbose:
            print content
        response = request.post(url,content)
        return response