Skip to content

Make compatible with Elasticsearch >0.90#6

Open
riker09 wants to merge 3 commits intodundalek:masterfrom
riker09:hotfix-elasticsearch
Open

Make compatible with Elasticsearch >0.90#6
riker09 wants to merge 3 commits intodundalek:masterfrom
riker09:hotfix-elasticsearch

Conversation

@riker09
Copy link

@riker09 riker09 commented Sep 23, 2016

I'm not sure if there are people who are using ES <= 0.90. The returned JSON when creating or updating documents has changed slightly.

OLD:

{
    "ok" : true,
    "_index" : "twitter",
    "_type" : "tweet",
    "_id" : "1",
    "_version" : 1
}

NEW:

{
    "_shards" : {
        "total" : 10,
        "failed" : 0,
        "successful" : 10
    },
    "_index" : "twitter",
    "_type" : "tweet",
    "_id" : "1",
    "_version" : 1,
    "created" : true
}

And when updating a document the key created is false, so I make a check for successful _shards. This is a quick and dirty proof-of-concept and definately needs some review since I'm a total ElasticSearch noob. 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant