def create_index_and_mapping(index_name): """Create the index, put mapping for each doc types. """ es = create_index(index_name) for doc_type, mapping in MAPPINGS.items(): es.indices.put_mapping(index=index_name, doc_type=doc_type, body=mapping)
def create_index_and_mapping(index_name): """Create the index, put mapping for each doc types. """ es = create_index(index_name) for doc_type, mapping in MAPPINGS.items(): es.indices.put_mapping( index=index_name, doc_type=doc_type, body=mapping )