elasticsearch/elasticsearch — Issue #1755: Mappings defined at index creation time in YAML are ignored
Author: yannk
Created: 2012-03-03 06:12:16+00:00
State: open

According to documentation I would have assumed that creation of mappings work in YAML too:
http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html

In JSON, it works as expected:
```
curl -XPUT $SERVER/$INDEX/ -d '
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"content": {
"properties": {
"exact": {
"index": "not_analyzed",
"type": "string"
}
}
}
}
```

But, the following doesn't work:
```
curl -XPUT $SERVER/$INDEX/ -d '
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
content:
properties:
exact:
index: not_analyzed
type: string
'
```

Below is my indexing and searching setup:
```
curl -XPUT $SERVER/$INDEX/content/1 -d '
{"exact": "The Field", "title": "one" }
'
curl -XPUT $SERVER/$INDEX/content/2 -d '
{"exact": "Astro Nomical", "title": "The second title" }
'

curl -XPOST $SERVER/$INDEX/_refresh

curl -XPOST $SERVER/$INDEX/content/_search -d '
{
"query": {
"filtered": {
"filter": {
"term": {
"exact": "The Field"
}
},
"query": {
"match_all": {}
}
}
}
}
'
```