koi2000 commented on code in PR #2856:
URL:
https://github.com/apache/incubator-hugegraph/pull/2856#discussion_r2286859398
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/schema/builder/IndexLabelBuilder.java:
##########
@@ -526,6 +532,21 @@ private void checkFields(Set<Id> propertyIds) {
"Search index can only build on text property, " +
"but got %s(%s)", dataType, field);
}
+
+ // Vector index must build on float list
+ if(this.indexType.isVector()){
+ E.checkArgument(fields.size() == 1,
+ "vector index can only build on " +
+ "one field, but got %s fields: '%s'",
+ fields.size(), fields);
+ String field = fields.iterator().next();
+ DataType dataType = this.graph().propertyKey(field).dataType();
+ Cardinality cardinality =
this.graph().propertyKey(field).cardinality();
+ E.checkArgument((dataType == DataType.FLOAT) &&
+ (cardinality == Cardinality.LIST),
+ "vector index can only build on Float List, " +
+ "but got %s(%s)", dataType, cardinality);
+ }
Review Comment:
code format
--
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]