Skip to content

Commit 1324663

Browse files
committed
Add docs for background indexing, update api.proto
1 parent 18b8ce5 commit 1324663

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,20 @@ Operation operation = Operation.newBuilder().setSchema(schema).build();
161161
dgraphClient.alter(operation);
162162
```
163163

164+
Starting Dgraph version 20.03.0, indexes can be computed in the background.
165+
You can call the function `setRunInBackground(true)` as shown below before
166+
calling `alter`. You can find more details
167+
[here](https://docs.dgraph.io/master/query-language/#indexes-in-background).
168+
169+
```java
170+
String schema = "name: string @index(exact) .";
171+
Operation op = Operation.newBuilder()
172+
.setSchema(schema)
173+
.setRunInBackground(true)
174+
.build();
175+
dgraphClient.alter(operation);
176+
```
177+
164178
`Operation` contains other fields as well, including drop predicate and
165179
drop all. Drop all is useful if you wish to discard all the data, and start from
166180
a clean slate, without bringing the instance down.

src/main/proto/api.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ message Operation {
101101
// If drop_op is ATTR or TYPE, drop_value holds the name of the predicate or
102102
// type to delete.
103103
string drop_value = 5;
104+
105+
// run indexes in background.
106+
bool run_in_background = 6;
104107
}
105108

106109
// Worker services.

0 commit comments

Comments
 (0)