Hello everyone,
I've noticed that include_in_all=false at the root object makes include_in_all=true ignored at field level.
Here is my mapping:
{
"sometype" : {
"_source" : { "enabled" : true},
"include_in_all" : false,
"dynamic" : "strict",
"properties" : {
"name" : {"index" : "analyzed", "analyzer" : "whitespace", "type" : "string", "store" : "yes", "include_in_all" : true},
"id" : {"index" : "not_analyzed", "type" : "integer", "store" : "yes"},
"text" : {"index" : "analyzed", "type" : "string", "store" : "no", "include_in_all" : true},
"date" : {"type" : "date" , "store" : "yes", "format" : "yyyy/MM/dd-HH:mm:ss"}
}
}
}
When I add a document, flush the index, close elasticsearch (I'm forced to by Luke) and inspect the index using Luke, I can see the field _all listed, but with 0 term associated!
Querying ?q=anyterm does not work (as no terms are listed in the _all field according to Luke).
In the page http://www.elasticsearch.org/guide/reference/mapping/core-types.html, you describe:
include_in_all : Should the field be included in the _all field (if enabled). Defaults to true or to the parent object type setting.
What I understand from the last sentence is that the default is inherited. In case the field isn't specified from the root level, it defaults to true. (And it is the case).
The only problem is that it always gets inherited, it overrides the descendant values, at least from root object to direct fields.
With such a behavior, I'm obliged to explicitly set include_in_all=false/true for each and every field.
Best,
Olivier Favre