@cli.command()<EOL>def reindex():
header('<STR_LIT>')<EOL>echo('<STR_LIT>', white(es.index_name))<EOL>if es.indices.exists(es.index_name):<EOL><INDENT>es.indices.delete(index=es.index_name)<EOL><DEDENT>es.initialize()<EOL>idx = <NUM_LIT:0><EOL>for idx, advice in enumerate(Advice.objects, <NUM_LIT:1>):<EOL><INDENT>index(advice)<EOL>echo('<STR_LIT:.>' if idx % <NUM_LIT:50> else white(idx), nl=False)<EOL><DEDENT>echo(white(idx) if idx % <NUM_LIT:50> else '<STR_LIT>')<EOL>es.indices.refresh(index=es.index_name)<EOL>success('<STR_LIT>', idx)<EOL>
Reindex all advices