benwtrent commented on code in PR #12373:
URL: https://github.com/apache/lucene/pull/12373#discussion_r1236979787
##########
lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java:
##########
@@ -31,6 +31,15 @@ public abstract class FloatVectorValues extends
DocIdSetIterator {
/** The maximum length of a vector */
public static final int MAX_DIMENSIONS = 1024;
+ /**
+ * This is the largest float vector value that we allow.
+ *
+ * <p>The largest float32 that you can square without overflowing is about
1.8E19. We reduce that
+ * further to accommodate the addition of multiple such components in
similarity computations in
+ * vectors up to MAX_DIMENSIONS in length.
+ */
+ public static final float MAX_FLOAT32_COMPONENT = 1E17f;
Review Comment:
squareDistance is very different than dotProduct and enforcing the same
limitations on both seems strange.
--
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]