@@ -219,7 +219,7 @@ func TestBulkLoadVectorIndex(t *testing.T) {
219219 t .Log ("Step 6: Verifying vector similarity queries work on bulk loaded data..." )
220220 fmt .Println ("vectors: " , len (vectors ))
221221 for i , vector := range vectors {
222- similarVectors , err := targetGc .QueryMultipleVectorsUsingSimilarTo (vector , pred , 10 )
222+ similarVectors , err := targetGc .QueryMultipleVectorsUsingSimilarTo (vector , pred , 5 )
223223 require .NoError (t , err )
224224 require .GreaterOrEqual (t , len (similarVectors ), 4 ,
225225 "similar_to query should return results for vector %d" , i )
@@ -255,9 +255,6 @@ func vectorsEqual(a, b []float32) bool {
255255 return true
256256}
257257
258- // TestBulkLoadVectorIndexMultipleGroups tests bulk loading vector data with multiple
259- // alpha groups (shards). This ensures vector indexing works correctly when predicates
260- // are distributed across different shards.
261258func TestBulkLoadVectorIndexMultipleGroups (t * testing.T ) {
262259 // if runtime.GOOS != "linux" && os.Getenv("DGRAPH_BINARY") == "" {
263260 // fmt.Println("You can set the DGRAPH_BINARY environment variable to path of a native dgraph binary to run these tests")
@@ -415,7 +412,7 @@ func TestBulkLoadVectorIndexMultipleGroups(t *testing.T) {
415412 sampleSize := 10
416413
417414 for i := 0 ; i < sampleSize ; i ++ {
418- similarVectors , err := targetGc .QueryMultipleVectorsUsingSimilarTo (vectors [i ], pred , 10 )
415+ similarVectors , err := targetGc .QueryMultipleVectorsUsingSimilarTo (vectors [i ], pred , 5 )
419416 require .NoError (t , err )
420417 require .GreaterOrEqual (t , len (similarVectors ), 4 ,
421418 "similar_to query should return results for predicate %s vector %d" , pred , i )
@@ -437,7 +434,7 @@ func TestBulkLoadMixedPredicates(t *testing.T) {
437434
438435 // Schema with vectors AND other indexed predicates
439436 mixedSchema := `
440- vec_embedding : float32vector @index(hnsw(exponent: "5", metric: "euclidean")) .
437+ project_description_v : float32vector @index(hnsw(exponent: "5", metric: "euclidean")) .
441438 name: string @index(term, fulltext) .
442439 age: int @index(int) .
443440 score: float .
@@ -485,7 +482,7 @@ func TestBulkLoadMixedPredicates(t *testing.T) {
485482 vecStr := fmt .Sprintf (`"[%s]"` , strings .Trim (strings .Join (strings .Fields (fmt .Sprint (vec )), ", " ), "[]" ))
486483
487484 // Add vector predicate
488- rdfBuilder .WriteString (fmt .Sprintf ("<0x%x> <vec_embedding > %s .\n " , uid , vecStr ))
485+ rdfBuilder .WriteString (fmt .Sprintf ("<0x%x> <project_description_v > %s .\n " , uid , vecStr ))
489486 // Add string predicate
490487 rdfBuilder .WriteString (fmt .Sprintf ("<0x%x> <name> \" Person %d\" .\n " , uid , i ))
491488 // Add int predicate
@@ -597,7 +594,7 @@ func TestBulkLoadMixedPredicates(t *testing.T) {
597594
598595 // Verify vector similarity query
599596 similarQuery := fmt .Sprintf (`{
600- vector(func: similar_to(vec_embedding , 5, "%v")) {
597+ vector(func: similar_to(project_description_v , 5, "%v")) {
601598 uid
602599 name
603600 }
@@ -610,8 +607,6 @@ func TestBulkLoadMixedPredicates(t *testing.T) {
610607 t .Log ("All mixed predicate types verified successfully!" )
611608}
612609
613- // TestBulkLoadVectorDimensions tests bulk loading vectors with different dimensions
614- // to ensure the implementation handles various vector sizes correctly.
615610func TestBulkLoadVectorDimensions (t * testing.T ) {
616611 // if runtime.GOOS != "linux" && os.Getenv("DGRAPH_BINARY") == "" {
617612 // t.Skip("Skipping test on non-Linux platforms due to dgraph binary dependency")
@@ -630,7 +625,7 @@ func TestBulkLoadVectorDimensions(t *testing.T) {
630625
631626 for _ , tc := range testCases {
632627 t .Run (tc .name , func (t * testing.T ) {
633- predName := fmt . Sprintf ( "vec_%s" , tc . name )
628+ predName := "project_description_v"
634629 schema := fmt .Sprintf (`%s: float32vector @index(hnsw(exponent: "5", metric: "euclidean")) .` , predName )
635630
636631 // Step 1: Create source cluster
@@ -704,7 +699,7 @@ func TestBulkLoadVectorDimensions(t *testing.T) {
704699
705700 targetCluster , err := dgraphtest .NewLocalCluster (targetConf )
706701 require .NoError (t , err )
707- defer func () { targetCluster .Cleanup (t .Failed ()) }()
702+ // defer func() { targetCluster.Cleanup(t.Failed()) }()
708703 require .NoError (t , targetCluster .Start ())
709704
710705 targetGc , targetCleanup , err := targetCluster .Client ()
@@ -724,15 +719,13 @@ func TestBulkLoadVectorDimensions(t *testing.T) {
724719 similarVectors , err := targetGc .QueryMultipleVectorsUsingSimilarTo (vector , predName , 5 )
725720 require .NoError (t , err )
726721 require .GreaterOrEqual (t , len (similarVectors ), 4 ,
727- "similar_to query should return results for vector %d " )
722+ "similar_to query should return results for vector" )
728723 }
729724
730725 })
731726 }
732727}
733728
734- // TestBulkLoadVectorMetrics tests bulk loading vectors with different distance metrics
735- // (euclidean, cosine, dotproduct) to ensure all HNSW configurations work correctly.
736729func TestBulkLoadVectorMetrics (t * testing.T ) {
737730 if runtime .GOOS != "linux" && os .Getenv ("DGRAPH_BINARY" ) == "" {
738731 t .Skip ("Skipping test on non-Linux platforms due to dgraph binary dependency" )
@@ -741,13 +734,13 @@ func TestBulkLoadVectorMetrics(t *testing.T) {
741734 metrics := []string {"euclidean" , "cosine" , "dotproduct" }
742735 numVectors := 200
743736 vectorDim := 10
737+ predName := "project_description_v"
744738
745739 // Build schema with all metric types
746740 var schemaBuilder strings.Builder
747741 for _ , metric := range metrics {
748742 schemaBuilder .WriteString (fmt .Sprintf (
749- "vec_%s: float32vector @index(hnsw(exponent: \" 5\" , metric: \" %s\" )) .\n " ,
750- metric , metric ))
743+ "project_description_v: float32vector @index(hnsw(exponent: \" 5\" , metric: \" %s\" )) .\n " , metric ))
751744 }
752745 schema := schemaBuilder .String ()
753746
@@ -779,7 +772,6 @@ func TestBulkLoadVectorMetrics(t *testing.T) {
779772 // Generate and load vectors for each metric type
780773 allVectors := make (map [string ][][]float32 )
781774 for _ , metric := range metrics {
782- predName := fmt .Sprintf ("vec_%s" , metric )
783775 rdfs , vectors := dgraphapi .GenerateRandomVectors (0 , numVectors , vectorDim , predName )
784776 allVectors [predName ] = vectors
785777
@@ -845,7 +837,6 @@ func TestBulkLoadVectorMetrics(t *testing.T) {
845837 // Step 5: Verify each metric type
846838 t .Log ("Step 5: Verifying each metric type..." )
847839 for _ , metric := range metrics {
848- predName := fmt .Sprintf ("vec_%s" , metric )
849840 vectors := allVectors [predName ]
850841
851842 // Verify count
@@ -872,8 +863,6 @@ func TestBulkLoadVectorMetrics(t *testing.T) {
872863 t .Log ("All vector metrics verified successfully!" )
873864}
874865
875- // TestBulkLoadVectorEdgeCases tests edge cases like empty vector predicates,
876- // single vector, and predicates with no data.
877866func TestBulkLoadVectorEdgeCases (t * testing.T ) {
878867 // if runtime.GOOS != "linux" && os.Getenv("DGRAPH_BINARY") == "" {
879868 // t.Skip("Skipping test on non-Linux platforms due to dgraph binary dependency")
0 commit comments