Skip to content

Commit

Permalink
Get max dimensions from codec
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakn7 committed Mar 1, 2024
1 parent be9afbb commit 127d3c1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.FloatVectorValues;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.VectorSimilarityFunction;
import org.apache.lucene.util.BytesRef;
Expand Down Expand Up @@ -135,9 +134,11 @@ protected void validateRequest(Field requestField) {
}

if (requestField.getSearch()) {
if (requestField.getVectorDimensions() > FloatVectorValues.MAX_DIMENSIONS) {
if (requestField.getVectorDimensions() > Lucene95HnswVectorsFormat.DEFAULT_MAX_DIMENSIONS) {
throw new IllegalArgumentException(
"Vector dimension must be <= " + FloatVectorValues.MAX_DIMENSIONS + " for search");
"Vector dimension must be <= "
+ Lucene95HnswVectorsFormat.DEFAULT_MAX_DIMENSIONS
+ " for search");
}
}
}
Expand Down

0 comments on commit 127d3c1

Please sign in to comment.