alessandrobenedetti commented on code in PR #1680:
URL: https://github.com/apache/solr/pull/1680#discussion_r1214612374
##########
solr/core/src/java/org/apache/solr/schema/DenseVectorField.java:
##########
@@ -218,22 +238,46 @@ public List<IndexableField> createFields(SchemaField
field, Object value) {
@Override
public IndexableField createField(SchemaField field, Object vectorValue) {
+ FieldType denseVectorFieldType = getDenseVectorFieldType();
+
+
if (vectorValue == null) return null;
DenseVectorParser vectorBuilder = (DenseVectorParser) vectorValue;
switch (vectorEncoding) {
case BYTE:
return new KnnByteVectorField(
- field.getName(), vectorBuilder.getByteVector(),
similarityFunction);
+ field.getName(), vectorBuilder.getByteVector(),
denseVectorFieldType);
case FLOAT32:
return new KnnFloatVectorField(
- field.getName(), vectorBuilder.getFloatVector(),
similarityFunction);
+ field.getName(), vectorBuilder.getFloatVector(),
denseVectorFieldType);
default:
throw new SolrException(
SolrException.ErrorCode.SERVER_ERROR,
"Unexpected state. Vector Encoding: " + vectorEncoding);
}
}
+ private FieldType getDenseVectorFieldType() {
Review Comment:
added in the latest commit, feel free to reword it though
--
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]