# Es.delete throwing error : trying to auto create mapping, but dynamic mapping is disabled

**URL:** <https://discuss.elastic.co/t/es-delete-throwing-error-trying-to-auto-create-mapping-but-dynamic-mapping-is-disabled/16188>\
**Category:** Elasticsearch\
**Created:** [March 6, 2014, 11:21am UTC](https://discuss.elastic.co/t/es-delete-throwing-error-trying-to-auto-create-mapping-but-dynamic-mapping-is-disabled/16188 "2014-03-06T11:21:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhupali\_Kalmegh](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bhupali\_Kalmegh](https://discuss.elastic.co/u/Bhupali_Kalmegh)\
**Post date:** [March 6, 2014, 11:21am UTC](https://discuss.elastic.co/t/es-delete-throwing-error-trying-to-auto-create-mapping-but-dynamic-mapping-is-disabled/16188/1 "2014-03-06T11:21:03Z")

</div>

Hi,

I have a Tweet index, with following defination. I inserted some data into  
it & now, I wish to delete the data for particular user. I tried following  
python code, but it is not working.

query = pyes.query.MatchAllQuery()  
equeue = es.search(query, 'tweet', 'blog')  
for row in equeue:  
if row["user"] == "User2":  
es.delete('tweet', 'blog', row.get\_id())

\*When I execute the above python django code, I get following exception, \*even  
the CURL command is not working

[tweet] type[blog] missing: trying to auto create mapping, but dynamicmapping is disabled

I modified the mapping to dynamic= True, still it doesn't work. Kindly  
help.

============================================

\*Tweet Index definition : \*

"tweet": {

```
    "tweet": {

        "index": {

            "number_of_shards": 2,

            "number_of_replicas": 1

        }

    },

    "mappings": {

        "blog": {

            "_all": {

                "enabled": False

            },

            "dynamic": False

        }

    }

}

```

_Tweet data insertion :_

curl -XPOST "[http://localhost:9200/tweet/blog/](http://localhost:9200/tweet/blog/)" -d'

{

```
"id" : "ID1",

"user" : "User1",

"title" : "tweet1"

```

}'

curl -XPOST "[http://localhost:9200/tweet/blog/](http://localhost:9200/tweet/blog/)" -d'

{

```
"id" : "ID2",

"user" : "User2",

"title" : "tweet2"

```

}'

_Read all data :_

curl -XGET "[http://localhost:9200/tweet/blog/\_search](http://localhost:9200/tweet/blog/_search)"

{

```
took: 1

timed_out: false

_shards: {

    total: 2

    successful: 2

    failed: 0

}

hits: {

    total: 2

    max_score: 1

    hits: [

        {

            _index: tweet

            _type: blog

            _id: 1

            _score: 1

            _source: {

                    id : ID1,

                    user : User1,

                    title : tweet1

            }

        },

        {

            _index: tweet

            _type: blog

            _id: 2

            _score: 1

            _source: {

                    id : ID2,

                    user : User2,

                    title : tweet2

            }

        }

```

}

================================================

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4005dfb4-8d0a-4919-a3b3-051eee682ac2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4005dfb4-8d0a-4919-a3b3-051eee682ac2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:45am UTC](https://discuss.elastic.co/t/es-delete-throwing-error-trying-to-auto-create-mapping-but-dynamic-mapping-is-disabled/16188/2 "2017-07-06T01:45:23Z")

</div>


