warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Make compatible with Elasticsearch >0.90

Open riker09 opened this issue 8 years ago • 0 comments

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. :grinning:

riker09 avatar Sep 23 '16 11:09 riker09