def add_completion(self, text, name, field, size=None, params=None):
        """
        Add completion-type suggestion:

        http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html

        :param text: text for searching using autocompletion
        :param name: name for the suggester
        :param field: document's field to be autocompleted
        :param size: (optional) size of the autocomplete list
        :return:
        """
        data = {
            'field': field
        }

        if size:
            data['size'] = size

        if params:
            data.update(params)

        self.fields[name] = {
            'text': text,
            'completion': data,
        }
def add_completion ( self , text , name , field , size = None , params = None ) : data = { 'field' : field } if size : data [ 'size' ] = size if params : data . update ( params ) self . fields [ name ] = { 'text' : text , 'completion' : data , }
Add completion-type suggestion:

        http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html

        :param text: text for searching using autocompletion
        :param name: name for the suggester
        :param field: document's field to be autocompleted
        :param size: (optional) size of the autocomplete list
        :return: