def search(self, query, index='default', **kwargs):
        """
        kwargs supported are the parameters listed at:
            http://www.elasticsearch.org/guide/reference/api/search/request-body/
        Namely: timeout, from, size and search_type.
        IMPORTANT: prepend ALL keys with "es_" as pyelasticsearch requires this
        """
        # Looking up the index
        if index not in self.conf.indexes:
            self.raise_improperly_configured(index=index)

        # Calling the backend search method
        esurl = self.conf.connections[index]['URL']
        esinst = pyelasticsearch.ElasticSearch(esurl)

        query = isinstance(query, Query) and str(query) or query
        self.raw_results = esinst.search(query, index=index, **kwargs)

        return self
def search ( self , query , index = 'default' , ** kwargs ) : if index not in self . conf . indexes : self . raise_improperly_configured ( index = index ) esurl = self . conf . connections [ index ] [ 'URL' ] esinst = pyelasticsearch . ElasticSearch ( esurl ) query = isinstance ( query , Query ) and str ( query ) or query self . raw_results = esinst . search ( query , index = index , ** kwargs ) return self
kwargs supported are the parameters listed at:
            http://www.elasticsearch.org/guide/reference/api/search/request-body/
        Namely: timeout, from, size and search_type.
        IMPORTANT: prepend ALL keys with "es_" as pyelasticsearch requires this