# Elasticsearch index creation from Python, results in error, for known mapping

**URL:** <https://discuss.elastic.co/t/elasticsearch-index-creation-from-python-results-in-error-for-known-mapping/381271>\
**Category:** Elasticsearch\
**Created:** [August 22, 2025, 6:45pm UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-from-python-results-in-error-for-known-mapping/381271 "2025-08-22T18:45:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave\_espinosa\_qs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dave_espinosa_qs/32/143411_2.png) [@dave\_espinosa\_qs](https://discuss.elastic.co/u/dave_espinosa_qs)\
**Post date:** [August 22, 2025, 6:45pm UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-from-python-results-in-error-for-known-mapping/381271/1 "2025-08-22T18:45:41Z")

</div>

I am trying to create an index from a Python script, but I am getting an error. [Find the whole description here](https://stackoverflow.com/q/79743751/16706763).

(IMPORTANT! I have not uploaded anything in this website, as every time I attempted, the attachments kept making the website crash)

What could be going on?

---

<div class="post-metadata">

**Author:** ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)\
**Post date:** [August 23, 2025, 3:18am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-from-python-results-in-error-for-known-mapping/381271/2 "2025-08-23T03:18:04Z")

</div>

Hello @dave_espinosa_qs

It seems as per the shared post, correct syntax for using custom analyzers is as below :

All custom analyzers you refer (`iq_text_base`, `i_text_bigram`, `q_text_bigram`, `i_prefix`, `q_prefix`, `iq_text_delimiter`, `iq_text_stem`) **must be defined** in `settings.analysis` and passed in the `settings` params when creating the index.

```auto
client.indices.create(
    settings={..},
    index="index_name",
    mappings={..}
    )

```

Thanks!!
