parser.py
def prep_es(es):
    """Cleanup existing indices and apply mapping"""
    if es.indices.exists(INDEX) is True:
        es.indices.delete(index=INDEX, ignore=[400, 404])

    mapping = Path("mapping.json")
    with mapping.open() as m:
        es.indices.create(INDEX, body=json.load(m))
Cleanup existing indices and apply mapping
Cleanup existing indices and apply mapping
Cleanup existing indices and apply mapping
def prep_es(es):
    if es.indices.exists(INDEX) is True:
        es.indices.delete(index=INDEX, ignore=[400, 404])
    mapping = Path("mapping.json")
    with mapping.open() as m:
        es.indices.create(INDEX, body=json.load(m))
def prep_es ( es ) : if es . indices . exists ( INDEX ) is True : es . indices . delete ( index = INDEX , ignore = [ 400 , 404 ] ) mapping = Path ( "mapping.json" ) with mapping . open ( ) as m : es . indices . create ( INDEX , body = json . load ( m ) )
Cleanup existing indices and apply mapping
Cleanup existing indices and apply mapping
"""Cleanup existing indices and apply mapping"""
es