rmuir commented on code in PR #14433:
URL: https://github.com/apache/lucene/pull/14433#discussion_r2034192030
##########
lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:
##########
@@ -161,6 +162,17 @@ public long computeNorm(FieldInvertState state) {
return SmallFloat.intToByte4(numTerms);
}
+ /**
+ * Decodes the normalization value as computed by {@link
#computeNorm(FieldInvertState)}, yielding
+ * the field's position length.
+ *
+ * @param norm from {@link
org.apache.lucene.index.NumericDocValues#longValue()} of the norm.
+ * @return position length
+ */
+ public long decodeNormToLength(long norm) {
+ return SmallFloat.byte4ToInt((byte) norm);
+ }
Review Comment:
Please remove this method as it is impossible for someone to implement
correctly if they customize just one field. The other method is per-field, this
one is not.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]