Different Length Strings with Same FieldNorm

On Thu, 2011-12-22 at 10:53 -0800, James Bathgate wrote:

I'm having an issue when using an nGram filter with the fieldNorm of
two fields with different length strings coming back with the same
fieldNorm. I've written a base simple test case for review which you
can see below. I just can't seem to figure out why "ktm monster
graphics" is getting the same score as "monster graphics". Can anyone
shed any light on this?

Field norms are stored in 8 bits, so small differences in field length,
when rounded down to 8 bits, are considered to be equal.

If you make the longer string just a bit longer (eg 'ktmxy monster
graphics') then you see a difference:

"hits" : {
"total" : 2,
"max_score" : 0.21019982,
"hits" : [ {
"_index" : "jtest",
"_type" : "test_type",
"_id" : "1",
"_score" : 0.21019982, "_source" : {
"test_value" : "monster graphics"
}
}, {
"_index" : "jtest",
"_type" : "test_type",
"_id" : "2",
"_score" : 0.18392484, "_source" : {
"test_value" : "ktmxy monster graphics"
}
} ]
}

clint