def serialize(self):
data = {'<STR_LIT>': self.doc}<EOL>if isinstance(self.query, Query):<EOL><INDENT>data['<STR_LIT>'] = self.query.serialize()<EOL><DEDENT>return data<EOL>
Serialize the query to a structure using the query DSL.