A `match_all` query should take the value stored in the norms field into account…, but it ignores it, even when the `norms_field` is specified in the query:
```
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d '
{
"mappings" : {
"test" : {
"_boost" : {
"null_value" : 1,
"name" : "boost"
}
}
}
}
'
curl -XPUT 'http://127.0.0.1:9200/test/test/1?pretty=1' -d '
{
"text" : "foo",
"boost" : 1
}
'
curl -XPUT 'http://127.0.0.1:9200/test/test/2?pretty=1' -d '
{
"text" : "foo",
"boost" : 2
}
'
curl -XPOST 'http://127.0.0.1:9200/test/_refresh?pretty=1'
```
The `match_all` gets translated to a constant score query, ignoring the norms field:
```
curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1' -d '
{
"query" : {
"match_all" : {
"norms_field" : "boost"
}
},
"explain" : 1
}
'
# [Fri Sep 21 16:48:10 2012] Response:
# {
# "hits" : {
# "hits" : [
# {
# "_source" : {
# "boost" : 1,
# "text" : "foo"
# },
# "_score" : 1,
# "_index" : "test",
# "_shard" : 2,
# "_id" : "1",
# "_node" : "BdOHDT8FT6yMecrZDzpkHA",
# "_type" : "test",
# "_explanation" : {
# "value" : 1,
# "details" : [
# {
# "value" : 1,
# "description" : "boost"
# },
# {
# "value" : 1,
# "description" : "queryNorm"
# }
# ],
# "description" : "ConstantScore(NotDeleted(cache(_type:test))), product of:"
# }
# },
# {
# "_source" : {
# "boost" : 2,
# "text" : "foo"
# },
# "_score" : 1,
# "_index" : "test",
# "_shard" : 3,
# "_id" : "2",
# "_node" : "BdOHDT8FT6yMecrZDzpkHA",
# "_type" : "test",
# "_explanation" : {
# "value" : 1,
# "details" : [
# {
# "value" : 1,
# "description" : "boost"
# },
# {
# "value" : 1,
# "description" : "queryNorm"
# }
# ],
# "description" : "ConstantScore(NotDeleted(cache(_type:test))), product of:"
# }
# }
# ],
# "max_score" : 1,
# "total" : 2
# },
# "timed_out" : false,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 5
# },
# "took" : 3
# }
```
The norms field is taken into account on other queris:
```
curl -XGET 'http://127.0.0.1:9200/test/test/_search?pretty=1' -d '
{
"query" : {
"text" : {
"text" : "foo"
}
},
"explain" : 1
}
'
# {
# "hits" : {
# "hits" : [
# {
# "_source" : {
# "boost" : 2,
# "text" : "foo"
# },
# "_score" : 0.61370564,
# "_index" : "test",
# "_shard" : 3,
# "_id" : "2",
# "_node" : "BdOHDT8FT6yMecrZDzpkHA",
# "_type" : "test",
# "_explanation" : {
# "value" : 0.61370564,
# "details" : [
# {
# "value" : 1,
# "description" : "tf(termFreq(text:foo)=1)"
# },
# {
# "value" : 0.30685282,
# "description" : "idf(docFreq=1, maxDocs=1)"
# },
# {
# "value" : 2,
# "description" : "fieldNorm(field=text, doc=0)"
# }
# ],
# "description" : "fieldWeight(text:foo in 0), product of:"
# }
# },
# {
# "_source" : {
# "boost" : 1,
# "text" : "foo"
# },
# "_score" : 0.30685282,
# "_index" : "test",
# "_shard" : 2,
# "_id" : "1",
# "_node" : "BdOHDT8FT6yMecrZDzpkHA",
# "_type" : "test",
# "_explanation" : {
# "value" : 0.30685282,
# "details" : [
# {
# "value" : 1,
# "description" : "tf(termFreq(text:foo)=1)"
# },
# {
# "value" : 0.30685282,
# "description" : "idf(docFreq=1, maxDocs=1)"
# },
# {
# "value" : 1,
# "description" : "fieldNorm(field=text, doc=0)"
# }
# ],
# "description" : "fieldWeight(text:foo in 0), product of:"
# }
# }
# ],
# "max_score" : 0.61370564,
# "total" : 2
# },
# "timed_out" : false,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 5
# },
# "took" : 3
# }
```