def add_completion(self, text, name, field, size=None, params=None):
data = {<EOL>'<STR_LIT>': field<EOL>}<EOL>if size:<EOL><INDENT>data['<STR_LIT:size>'] = size<EOL><DEDENT>if params:<EOL><INDENT>data.update(params)<EOL><DEDENT>self.fields[name] = {<EOL>'<STR_LIT:text>': text,<EOL>'<STR_LIT>': data,<EOL>}<EOL>
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: