elasticsearch/elasticsearch-rails — pull request #138 by rsutphin (2014-06-05 17:55:23+00:00)
Title: Support 1.0-style multi_fields in the mapping DSL

This branch updates the `mapping` DSL to have nested `indexes` calls produce embedded fields (instead of properties) for the core types where this is appropriate.

This mapping syntax is allowed starting with [elasticsearch 1.0][es10mf] as a replacement for `multi_field`.

[es10mf]: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_multi_fields.html

`type: "multi_field"` will still work as before; this change should not break backwards compatibility.

A workaround before this patch (or its equivalent) is merged is to define the nested fields using a hash. E.g.:

```
indexes :foo, type: 'string', fields: { raw: { type: "string", analyzer: "keywords" } }
```

With this patch, the same mapping can be written as:

```
indexes :foo, type: 'string' do
indexes :raw, analyzer: 'keywords'
end