res = requests.head(f"{url}/{index}")
if res.status_code != 200:
raise Error('')
Create new Index
res = requests.put(
f"{url}/{index}"
headers={'Content-Type': 'application/json'},
json=tokenizer_mapping
)
if res.json()['acknowledged'] is False:
raise Error('')