cpoerschke commented on code in PR #13525:
URL: https://github.com/apache/lucene/pull/13525#discussion_r1664102266
##########
lucene/core/src/java/org/apache/lucene/codecs/lucene99/Lucene99HnswVectorsReader.java:
##########
@@ -209,17 +210,17 @@ public static VectorEncoding readVectorEncoding(DataInput
input) throws IOExcept
private FieldEntry readField(IndexInput input, FieldInfo info) throws
IOException {
VectorEncoding vectorEncoding = readVectorEncoding(input);
- VectorSimilarityFunction similarityFunction =
readSimilarityFunction(input);
- if (similarityFunction != info.getVectorSimilarityFunction()) {
+ VectorSimilarityFunction vectorSimilarityFunction =
readSimilarityFunction(input);
+ if (vectorSimilarityFunction != info.getVectorSimilarityFunction()) {
throw new IllegalStateException(
"Inconsistent vector similarity function for field=\""
+ info.name
+ "\"; "
- + similarityFunction
+ + vectorSimilarityFunction
+ " != "
+ info.getVectorSimilarityFunction());
}
- return FieldEntry.create(input, vectorEncoding,
info.getVectorSimilarityFunction());
+ return FieldEntry.create(info, input, vectorEncoding,
info.getVectorSimilarityFunction());
Review Comment:
Having both `info` and `info.getVectorSimilarityFunction()` jumps out here.
```suggestion
return FieldEntry.create(info, input, vectorEncoding);
```
or
```suggestion
return FieldEntry.create(info, input, vectorEncoding,
vectorSimilarityFunction);
```
##########
lucene/core/src/java/org/apache/lucene/index/FieldInfo.java:
##########
@@ -92,6 +97,8 @@ public FieldInfo(
int vectorDimension,
VectorEncoding vectorEncoding,
VectorSimilarityFunction vectorSimilarityFunction,
+ boolean isTensor,
+ TensorSimilarityFunction.Aggregation tensorAggregate,
Review Comment:
naive question: is `isTensor` possible/meaningful without `tensorAggregate`
and vice versa? and/or could a special
`TensorSimilarityFunction.Aggregation.NONE` mean no-tensors?
```suggestion
TensorSimilarityFunction.Aggregation tensorAggregate,
```
--
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]