def initialize(self):
if es.indices.exists(self.index_name):<EOL><INDENT>es.indices.put_mapping(index=self.index_name, doc_type=DOCTYPE, body=MAPPING)<EOL><DEDENT>else:<EOL><INDENT>es.indices.create(self.index_name, {<EOL>'<STR_LIT>': {'<STR_LIT>': MAPPING},<EOL>'<STR_LIT>': {'<STR_LIT>': ANALSYS},<EOL>})<EOL><DEDENT>
Create or update indices and mappings