MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / TestVectorIndexRebuildWhenChange

Function TestVectorIndexRebuildWhenChange

query/vector/vector_test.go:402–418  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

400}
401
402func TestVectorIndexRebuildWhenChange(t *testing.T) {
403 dropPredicate("vtest")
404 setSchema(fmt.Sprintf(vectorSchemaWithIndex, "vtest", "4", "euclidean"))
405
406 numVectors := 9000
407 vectorSize := 100
408
409 randomVectors, _ := generateRandomVectors(numVectors, vectorSize, "vtest")
410 require.NoError(t, addTriplesToCluster(randomVectors))
411
412 startTime := time.Now()
413 setSchema(fmt.Sprintf(vectorSchemaWithIndex, "vtest", "6", "euclidean"))
414
415 dur := time.Since(startTime)
416 // Easy way to check that the index was actually rebuilt
417 require.Greater(t, dur, time.Second*4)
418}
419
420func TestSimilarToOptionsIntegration(t *testing.T) {
421 const pred = "voptions"

Callers

nothing calls this directly

Calls 4

generateRandomVectorsFunction · 0.85
dropPredicateFunction · 0.70
setSchemaFunction · 0.70
addTriplesToClusterFunction · 0.70

Tested by

no test coverage detected