You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/deploy/cli-command-reference.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,7 @@ The `--badger` superflag allows you to set many advanced [Badger options](https:
128
128
|`--query_edge_limit`| uint64 |`query-edge`| uint64 |`alpha`| Maximum number of edges that can be returned in a query |
129
129
|`--normalize_node_limit`| int |`normalize-node`| int |`alpha`| Maximum number of nodes that can be returned in a query that uses the normalize directive |
130
130
|`--mutations_nquad_limit`| int |`mutations-nquad`| int |`alpha`| Maximum number of nquads that can be inserted in a mutation request |
131
+
|`--max-pending-queries`| int |`max-pending-queries`| int |`alpha`| Maximum number of concurrently processing requests allowed before requests are rejected with 429 Too Many Requests |
Copy file name to clipboardExpand all lines: content/design-concepts/replication-concept.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,4 +9,4 @@ weight = 85
9
9
Each Highly-Available (HA) group will be served by at least 3 instances (or two if one is temporarily unavailable). In the case of an alpha instance
10
10
failure, other alpha instances in the same group still handle the load for data in that group. In case of a zero instance failure, the remaining two zeros in the zero group will continue to hand out timestamps and perform other zero functions.
11
11
12
-
In addition, Dgraph `Learner Nodes` are alpha instances that hold replicas of data, but this replication is to suupport read replicas, often in a different geography from the master cluster. This replication is implemented the same way as HA replication, but the learner nodes do not participate in quorum, and do not take over from failed nodes to provide high availability.
12
+
In addition, Dgraph `Learner Nodes` are alpha instances that hold replicas of data, but this replication is to support read replicas, often in a different geography from the master cluster. This replication is implemented the same way as HA replication, but the learner nodes do not participate in quorum, and do not take over from failed nodes to provide high availability.
@@ -112,6 +117,15 @@ For all triples with a predicate of scalar types the object is a literal.
112
117
are RFC 3339 compatible which is different from ISO 8601(as defined in the RDF spec). You should
113
118
convert your values to RFC 3339 format before sending them to Dgraph.{{% /notice %}}
114
119
120
+
### Vector Type
121
+
122
+
The `float32vector` type denotes a vector of floating point numbers, i.e an ordered array of float32. A node type can contain more than one vector predicate.
123
+
124
+
Vectors are normaly used to store embeddings obtained from other information through an ML model. When a `float32vector` is [indexed]({{<relref "dql/predicate-indexing.md">}}), the DQL [similar_to]({{<relref "query-language/functions#vector-similarity-search">}}) function can be used for similarity search.
125
+
126
+
127
+
128
+
115
129
### UID Type
116
130
117
131
The `uid` type denotes a relationship; internally each node is identified by it's UID which is a `uint64`.
|`similar_to`|`hnsw`| HNSW index supports parameters `metric` and `exponent`. |
55
+
56
+
57
+
#
58
+
59
+
`hnsw` (**Hierarchical Navigable Small World**) index supports the following parameters
60
+
- metric : indicate the metric to use to compute vector similarity. One of `cosine`, `euclidean`, and `dotproduct`. Default is `euclidean`.
61
+
62
+
- exponent : An integer, represented as a string, roughly representing the number of vectors expected in the index in power of 10. The exponent value,is used to set "reasonable defaults" for HNSW internal tuning parameters. Default is "4" (10^4 vectors).
description = "Dgraph automatically generates GraphQL queries for each vector index that you define in your schema. There are two types of queries generated for each index."
4
+
weight = 3
5
+
[menu.main]
6
+
parent = "graphql-queries"
7
+
identifier = "vector-queries"
8
+
+++
9
+
10
+
Dgraph automatically generates two GraphQL similarity queries for each type that have at least one [vector predicate](/graphql/schema/types/#vectors) with `@search` directive.
Withtheaboveschema, the auto-generated `querySimilar<Object>ByEmbedding` query allows us to run similarity search using the vector index specified in our schema.
23
+
24
+
```graphql
25
+
getSimilar<Object>ByEmbedding(
26
+
by: vector_predicate,
27
+
topK: n,
28
+
vector: searchVector): [User]
29
+
```
30
+
31
+
For example in order to find top 3 users with names similar to a given user name embedding the following query function can be used.
The results obtained for this query includes the 3 closest Users ordered by vector_distance. The vector_distance is the Euclidean distance between the name_v embedding vector and the input vector used in our query.
41
+
42
+
Note: you can omit vector_distance predicate in the query, the result will still be ordered by vector_distance.
43
+
44
+
The distance metric used is specified in the index creation.
45
+
46
+
Similarly, the auto-generated `querySimilar<Object>ById` query allows us to search for similar objects to an existing object, given it’s Id. using the function.
47
+
48
+
```graphql
49
+
getSimilar<Object>ById(
50
+
by: vector_predicate,
51
+
topK: n,
52
+
id: userID): [User]
53
+
```
54
+
55
+
For example the following query searches for top 3 users whose names are most similar to the name of the user with id "0xef7".
0 commit comments