How to disable "Norms" for all field?


#1

I noticed the doc said the Norms can be disabled for specific field. Can Norms be disabled for all document field?

I did a index templete like below
{
"my_index" : {
"template" : "",
"mappings" : {
"default" : {
"_all" : {"enabled" : false},
"dynamic_templates": [
{
"no_norms" : {
"match": "
",
"mapping": {
"properties": {
"type" : "string",
"norms" : { "enabled" : false }
}
}
}
}
]

            }
    }

}
and this can work, but I can still see _score in query result. Is there something wrong?

curl -XGET 'http://localhost:9200/lsfnew6/test/_search?q=aa:abc&pretty=true'
{
"took" : 10,
"timed_out" : false,
"_shards" : {
"total" : 3,
"successful" : 3,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.30685282,
"hits" : [ {
"_index" : "lsfnew6",
"_type" : "test",
"_id" : "1",
"_score" : 0.30685282,
"_source":{"aa":"abc","bb":"xyz"}
} ]
}
}


Disable norms for all fields
(Mark Walkom) #2

You need to do this per field - https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-core-types.html#norms


#3

That's bad news. It should be a simple way : (


(Mark Walkom) #4

Feel free to raise a feature request on GH then, we're always open to community suggestions to make things easier :slight_smile:


(Dominik Stadler) #5

Discussion at https://github.com/elastic/elasticsearch/issues/19716 seems to indicate that it should work when the correct index-template is used.


(system) #6