We are using templates in mappings. Because of this the initializations of templates have to be done before initializations of mappings. The init of the cli has to be changed accordantly.
@index.command()
@click.option('--force', is_flag=True, default=False)
@with_appcontext
@es_version_check
def init(force):
"""Initialize registered aliases and mappings."""
click.secho('Putting templates...', fg='green', bold=True, file=sys.stderr)
with click.progressbar(
current_search.put_templates(ignore=[400] if force else None),
length=len(current_search.templates)) as bar:
for response in bar:
bar.label = response
click.secho('Creating indexes...', fg='green', bold=True, file=sys.stderr)
with click.progressbar(
current_search.create(ignore=[400] if force else None),
length=len(current_search.mappings)) as bar:
for name, response in bar:
bar.label = name
```
We are using templates in mappings. Because of this the initializations of templates have to be done before initializations of mappings. The
initof theclihas to be changed accordantly.