instedd / mbuilder

Scalable SMS application builder
http://mbuilder.instedd.org/
6 stars 1 forks source link

Upgrade to Elasticsearch 2.x #342

Closed asterite closed 8 years ago

asterite commented 8 years ago

Since Elasticsearch 2.x fields cannot be referenced by short name: https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_fields_cannot_be_referenced_by_short_name

So for example in a document like this

{
  "properties": {
    "age": 10
  }
}

we must use "properties.age" in queries.

We do this for fields that are not named "created_at" and "updated_at", I don't know if other fields need to be ignored as well. I also don't know why the properties are inside another "properties" and not just outside it, would probably be easier to upgrade and to deal with...

/cc @bcardiff @nekron

asterite commented 8 years ago

Fixes #341

asterite commented 8 years ago

Merging because specs passed, so this is also backwards compatible :-)