This is a low-level API, you should only extend this API if you want to implement
an information retrieval model. If you are instead looking for a convenient way
to alter Lucene's scoring, consider extending a higher-level implementation
such as TFIDFSimilarity, which implements the vector space model with this API, or
just tweaking the default implementation: DefaultSimilarity.

Similarity determines how Lucene weights terms, and Lucene interacts with
this class at both index-time and
query-time.

At indexing time, the indexer calls computeNorm(FieldInvertState), allowing
the Similarity implementation to set a per-document value for the field that will
be later accessible via AtomicReader.getNormValues(String). Lucene makes no assumption
about what is in this norm, but it is most useful for encoding length normalization
information.

Implementations should carefully consider how the normalization is encoded: while
Lucene's classical TFIDFSimilarity encodes a combination of index-time boost
and length normalization information with SmallFloat into a single byte, this
might not be suitable for all purposes.

Finally, using index-time boosts (either via folding into the normalization byte or
via DocValues), is an inefficient way to boost the scores of different fields if the
boost will be the same for every document, instead the Similarity can simply take a constant
boost parameter C, and PerFieldSimilarityWrapper can return different
instances with different boosts depending upon field name.