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

Function TestVectorSchema

query/vector/vector_graphql_test.go:165–181  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestVectorSchema(t *testing.T) {
166 require.NoError(t, client.DropAll())
167
168 hc, err := dc.HTTPClient()
169 require.NoError(t, err)
170 hc.LoginIntoNamespace("groot", "password", 0)
171
172 schema := `type Project {
173 id: ID!
174 title: String! @search(by: [exact])
175 title_v: [Float!]
176 }`
177
178 // add schema
179 require.NoError(t, hc.UpdateGQLSchema(schema))
180 require.Error(t, hc.UpdateGQLSchema(fmt.Sprintf(graphQLVectorSchema, "euclidean")))
181}
182
183func TestVectorGraphQlEuclideanIndexMutationAndQuery(t *testing.T) {
184 require.NoError(t, client.DropAll())

Callers

nothing calls this directly

Calls 5

DropAllMethod · 0.80
LoginIntoNamespaceMethod · 0.80
UpdateGQLSchemaMethod · 0.80
HTTPClientMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected