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/"; -d'

{

    "id" : "ID1",

    "user" : "User1",

    "title" : "tweet1"

}'

curl -XPOST "http://localhost:9200/tweet/blog/"; -d'

{

    "id" : "ID2",

    "user" : "User2",

    "title" : "tweet2"

}'

 

*Read all data :*

curl -XGET "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 [email protected].
To view this discussion on the web visit 
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.

Reply via email to