Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Sep 11, 2024
1 parent d9a6aa8 commit 9a568be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions graphql/schema/dgraph_schemagen_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ schemas:
dt4: DateTime @search(by: [day])
dt5: DateTime @search(by: [hour])
vf1: [Float!] @embedding @search(by: ["hnsw"])
vf2: [Float!] @embedding @search(by: ["hnsw(exponent: 4, metric: euclidian)"])
vf2: [Float!] @embedding @search(by: ["hnsw(exponent: 4, metric: euclidean)"])
vf3: [Float!] @embedding @search(by: ["hnsw(metric: cosine)"])
vf4: [Float!] @embedding @search(by: ["hnsw(metric: dotproduct, exponent: 4)"])
e: E @search
Expand Down Expand Up @@ -219,7 +219,7 @@ schemas:
X.dt4: dateTime @index(day) .
X.dt5: dateTime @index(hour) .
X.vf1: float32vector @index(hnsw) .
X.vf2: float32vector @index(hnsw(exponent: "4", metric: "euclidian")) .
X.vf2: float32vector @index(hnsw(exponent: "4", metric: "euclidean")) .
X.vf3: float32vector @index(hnsw(metric: "cosine")) .
X.vf4: float32vector @index(hnsw(exponent: "4", metric: "dotproduct")) .
X.e: string @index(hash) .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Product {
description: String
title: String
imageUrl: String
product_vector: [Float!] @embedding @search(by: ["hnsw(metric: euclidian, exponent: 4)"])
product_vector: [Float!] @embedding @search(by: ["hnsw(metric: euclidean, exponent: 4)"])
}

type Purchase @lambdaOnMutate(add: true){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Product {
description: String
title: String
imageUrl: String
product_vector: [Float!] @embedding @search(by: ["hnsw(metric: euclidian, exponent: 4)"])
product_vector: [Float!] @embedding @search(by: ["hnsw(metric: euclidean, exponent: 4)"])
vector_distance: Float
}

Expand Down
8 changes: 4 additions & 4 deletions tok/options/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ In Dgraph, we have the abiltity to specify an @index directive for the type
vfloat. Here, we want to expand that capability to allow us to specify something
like:

myAttribute @index("hnsw-euclidian","maxNeighbors":"5","maxLevels":"5","exponent":"6")
myAttribute @index("hnsw-euclidean","maxNeighbors":"5","maxLevels":"5","exponent":"6")

Roughly, this should be read as:
I want to specify an HNSW-type vector index using euclidian distance as a metric
I want to specify an HNSW-type vector index using euclidean distance as a metric
with maxNeighbors, maxLevels, and exponent being declared as written, and with
all other parameters taking on default values. (In the case of specifying an
exponent, this should affect the defaults for the other options, but that is
Expand All @@ -20,10 +20,10 @@ types". Hence, we get the AllowedOptions class, which specifies a set of
named options and corresponding parsers for the given name.

Now, if we want to populate an Options instance based on the content of
myAttribute @index(hnsw(metric:"euclidian",exponent:"6")),
myAttribute @index(hnsw(metric:"euclidean",exponent:"6")),

we collect the key-value pairs:
"metric":"euclidian"
"metric":"euclidean"
"exponent":"6"

And we can now invoke:
Expand Down

0 comments on commit 9a568be

Please sign in to comment.