MCPcopy
hub / github.com/dgraph-io/dgraph / TestVectorIndexOnVectorPredWithoutData

Function TestVectorIndexOnVectorPredWithoutData

systest/vector/vector_test.go:282–305  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

280}
281
282func TestVectorIndexOnVectorPredWithoutData(t *testing.T) {
283 conf := dgraphtest.NewClusterConfig().WithNumAlphas(1).WithNumZeros(1).WithReplicas(1).WithACL(time.Hour)
284 c, err := dgraphtest.NewLocalCluster(conf)
285 require.NoError(t, err)
286 defer func() { c.Cleanup(t.Failed()) }()
287 require.NoError(t, c.Start())
288
289 gc, cleanup, err := c.Client()
290 require.NoError(t, err)
291 defer cleanup()
292 require.NoError(t, gc.LoginIntoNamespace(context.Background(),
293 dgraphapi.DefaultUser, dgraphapi.DefaultPassword, x.RootNamespace))
294
295 hc, err := c.HTTPClient()
296 require.NoError(t, err)
297 require.NoError(t, hc.LoginIntoNamespace(dgraphapi.DefaultUser,
298 dgraphapi.DefaultPassword, x.RootNamespace))
299
300 require.NoError(t, gc.SetupSchema(testSchema))
301
302 vector := []float32{1.0, 2.0, 3.0}
303 _, err = gc.QueryMultipleVectorsUsingSimilarTo(vector, pred, 10)
304 require.NoError(t, err)
305}
306
307func TestVectorIndexDropPredicate(t *testing.T) {
308 conf := dgraphtest.NewClusterConfig().WithNumAlphas(1).WithNumZeros(1).WithReplicas(1).WithACL(time.Hour)

Callers

nothing calls this directly

Calls 14

CleanupMethod · 0.95
StartMethod · 0.95
ClientMethod · 0.95
HTTPClientMethod · 0.95
NewClusterConfigFunction · 0.92
NewLocalClusterFunction · 0.92
cleanupFunction · 0.85
WithACLMethod · 0.80
WithReplicasMethod · 0.80
WithNumZerosMethod · 0.80
WithNumAlphasMethod · 0.80
LoginIntoNamespaceMethod · 0.80

Tested by

no test coverage detected