Skip to content

Commit

Permalink
Add docs for background indexing, update api.proto
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Mar 25, 2020
1 parent 18b8ce5 commit 1324663
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ Operation operation = Operation.newBuilder().setSchema(schema).build();
dgraphClient.alter(operation);
```

Starting Dgraph version 20.03.0, indexes can be computed in the background.
You can call the function `setRunInBackground(true)` as shown below before
calling `alter`. You can find more details
[here](https://docs.dgraph.io/master/query-language/#indexes-in-background).

```java
String schema = "name: string @index(exact) .";
Operation op = Operation.newBuilder()
.setSchema(schema)
.setRunInBackground(true)
.build();
dgraphClient.alter(operation);
```

`Operation` contains other fields as well, including drop predicate and
drop all. Drop all is useful if you wish to discard all the data, and start from
a clean slate, without bringing the instance down.
Expand Down
3 changes: 3 additions & 0 deletions src/main/proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ message Operation {
// If drop_op is ATTR or TYPE, drop_value holds the name of the predicate or
// type to delete.
string drop_value = 5;

// run indexes in background.
bool run_in_background = 6;
}

// Worker services.
Expand Down

0 comments on commit 1324663

Please sign in to comment.