mayya-sharipova commented on code in PR #947: URL: https://github.com/apache/lucene/pull/947#discussion_r923672692
########## lucene/core/src/java/org/apache/lucene/codecs/lucene93/Lucene93HnswVectorsReader.java: ########## @@ -169,7 +173,12 @@ private void validateFieldEntry(FieldInfo info, FieldEntry fieldEntry) { + fieldEntry.dimension); } - long numBytes = (long) fieldEntry.size() * dimension * Float.BYTES; + long numBytes; + switch (fieldEntry.vectorEncoding) { + case BYTE -> numBytes = (long) fieldEntry.size() * dimension; + case FLOAT32 -> numBytes = (long) fieldEntry.size() * dimension * Float.BYTES; + default -> throw new AssertionError("unknown vector encoding " + fieldEntry.vectorEncoding); Review Comment: Should we also update the error message that follows for `BYTE` case? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org