finally, "holy grail" where similarities can declare the normalization factor(s) they need, using byte/float/int whatever, and its all unified with the docvalues api. IndexReader.norms() maybe goes away here, and maybe NormsFormat too.
Thinking about this: a clean way to do it would be for Similarity to get a new method:
and we would change:
byte computeNorm(FieldInvertState state);
void computeNorm(FieldInvertState state, PerDocFieldValues norm);
Sims that want to encode multiple index-time scoring factors separately
could just use BYTES_FIXED_STRAIGHT. This should be only for some rare
sims anyway, because a Sim can pull named 'application' specific scoring
factors from IR.perDocValues() today already.
Its not too crazy either since sims are already doing their own encoding,
so e.g. default sim would just use FIXED_INTS_8.
People that don't want to mess with bytes or smallfloat could use things
like FLOAT_32 if they want and need this.
we would just change FieldInfo.omitNorms to instead be FieldInfo.normValueType,
which is the value type of the norm (null if its omitted, just like docValueType).
Preflex FieldInfosReader would just set FIXED_INTS_8 or null, based on
whether the fieldinfos had omitNorms or not. it doesnt support
any other types...
Finally then, sims would be own their scoring factors, and we could
even remove omitNorms from Field/FieldType etc (just use the correct
scoring algorithm for the field, if you don't want norms, use a sim
that doesn't need them for scoring)
This would remove the awkward/messy situation where every similarity
implementation we have has to 'downgrade' itself to handle things like
if the user decided to omit parts of their formula!