def add(self, text, name, field, type='term', size=None, params=None):
        """
        Set the suggester of given type.

        :param text: text
        :param name: name of suggest
        :param field: field to be used
        :param type: type of suggester to add, available types are: completion,
                     phrase, term
        :param size: number of phrases
        :param params: dict of additional parameters to pass to the suggester
        :return: None
        """
        func = None

        if type == 'completion':
            func = self.add_completion
        elif type == 'phrase':
            func = self.add_phrase
        elif type == 'term':
            func = self.add_term
        else:
            raise InvalidQuery('Invalid type')

        func(text=text, name=name, field=field, size=size, params=params)
def add ( self , text , name , field , type = 'term' , size = None , params = None ) : func = None if type == 'completion' : func = self . add_completion elif type == 'phrase' : func = self . add_phrase elif type == 'term' : func = self . add_term else : raise InvalidQuery ( 'Invalid type' ) func ( text = text , name = name , field = field , size = size , params = params )
Set the suggester of given type.

        :param text: text
        :param name: name of suggest
        :param field: field to be used
        :param type: type of suggester to add, available types are: completion,
                     phrase, term
        :param size: number of phrases
        :param params: dict of additional parameters to pass to the suggester
        :return: None