def create_percolator(self, index, name, query, **kwargs):
if isinstance(query, Query):<EOL><INDENT>query = {"<STR_LIT>": query.serialize()}<EOL><DEDENT>if not isinstance(query, dict):<EOL><INDENT>raise InvalidQuery("<STR_LIT>")<EOL><DEDENT>if kwargs:<EOL><INDENT>query.update(kwargs)<EOL><DEDENT>path = make_path(index, '<STR_LIT>', name)<EOL>body = json.dumps(query, cls=self.encoder)<EOL>return self._send_request('<STR_LIT>', path, body)<EOL>
Create a percolator document

Any kwargs will be added to the document as extra properties.