File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Database/Validator/Query Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -341,7 +341,13 @@ public function isValid($value): bool
341341 return false ;
342342 }
343343
344- $ attributeSchema = $ this ->schema [$ attribute ];
344+ // Handle dotted attributes (relationships)
345+ $ attributeKey = $ attribute ;
346+ if (\str_contains ($ attributeKey , '. ' ) && !isset ($ this ->schema [$ attributeKey ])) {
347+ $ attributeKey = \explode ('. ' , $ attributeKey )[0 ];
348+ }
349+
350+ $ attributeSchema = $ this ->schema [$ attributeKey ];
345351 if ($ attributeSchema ['type ' ] !== Database::VAR_VECTOR ) {
346352 $ this ->message = 'Vector queries can only be used on vector attributes ' ;
347353 return false ;
@@ -353,7 +359,6 @@ public function isValid($value): bool
353359 }
354360
355361 return $ this ->isValidAttributeAndValues ($ attribute , $ value ->getValues (), $ method );
356-
357362 case Query::TYPE_OR :
358363 case Query::TYPE_AND :
359364 $ filters = Query::groupByType ($ value ->getValues ())['filters ' ];
You can’t perform that action at this time.
0 commit comments