Skip to content

Commit 105c33b

Browse files
committed
Update api.proto and add docs for indexing in background
1 parent 07ed42a commit 105c33b

File tree

3 files changed

+96
-73
lines changed

3 files changed

+96
-73
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ op = pydgraph.Operation(schema=schema)
9090
client.alter(op)
9191
```
9292

93+
Starting Dgraph version 20.03.0, indexes can be computed in the background.
94+
You can set `run_in_background` field of the `pydgraph.Operation` to `True`
95+
before passing it to the `Alter` function. You can find more details
96+
[here](https://docs.dgraph.io/master/query-language/#indexes-in-background).
97+
98+
```python
99+
schema = 'name: string @index(exact) .'
100+
op = pydgraph.Operation(schema=schema, run_in_background=True)
101+
client.alter(op)
102+
```
103+
93104
`Operation` contains other fields as well, including drop predicate and drop all.
94105
Drop all is useful if you wish to discard all the data, and start from a clean
95106
slate, without bringing the instance down.

pydgraph/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)