Exclude particular fields from [all_field] searches

Hello Mark,

I have executed following code and it seems under the hood _all field is used. That means, the feature of elasticsearch 5.1 can not be used where we can disable the _all field completely.

DELETE test_index

PUT test_index
{
"mappings": {
"user": {
"include_in_all": false,
"properties": {
"title": { "type": "text", "include_in_all": true },
"name": { "type": "text", "include_in_all": true },
"age": { "type": "integer" },
"tags": { "type": "text", "include_in_all": false }
}
}
}
}

POST test_index/_bulk
{ "index" : { "_type" : "user", "_id" : "1" } }
{ "name" : "niaz", "title" : "test", "age" : 40, "tags" : "toyota, bmw" }
{ "index" : { "_type" : "user", "_id" : "2" } }
{ "name" : "john", "title" : "toyota", "age" : 30 }
{ "index" : { "_type" : "user", "_id" : "3" } }
{ "name" : "bell", "title" : "mercedes", "age" : 35 }
{ "index" : { "_type" : "user", "_id" : "4" } }
{ "name" : "akram", "title" : "bmw", "age" : 42 }

GET test_index/_search
{
"query": {
"query_string": {
"query": "toyota"
}
}
}

The query under 4 results ONE document, CORRECT as we had disabled "include_in_all" from our "tags" field.

Now update the mapping for "tags" field like below:

PUT test_index/_mapping/user
{
"properties": {
"tags" : { "type": "text", "include_in_all": true }
}
}

Execute the query from point 4 again and it will return again 1 document. That means, the "include_in_all" cannot be changed dynamically. Instead the documents that are already indexed will not be affected when this setting is changed from false to true or vice versa.

I post one more document using below command.
POST test_index/_bulk
{ "index" : { "_type" : "user", "_id" : "5" } }
{ "name" : "Mark Walkom", "title" : "elastic", "age" : 35, "tags" : "toyota, tesla" }

Execute the query under (4) again and this time 2 documents will be returned as the "tags" field from (6) is indexed.

My point: I want to use the feature of elastic search 5.1 where _all field can be disabled by default and all fields are indexed only once. At the time of search, when no default field is provided a user configured _all field should be used for searching. Please accept this feature request for next version of elastic search.

Thanks
Niaz