File tree Expand file tree Collapse file tree 3 files changed +96
-73
lines changed Expand file tree Collapse file tree 3 files changed +96
-73
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,17 @@ op = pydgraph.Operation(schema=schema)
90
90
client.alter(op)
91
91
```
92
92
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
+
93
104
` Operation ` contains other fields as well, including drop predicate and drop all.
94
105
Drop all is useful if you wish to discard all the data, and start from a clean
95
106
slate, without bringing the instance down.
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ message Operation {
101
101
// If drop_op is ATTR or TYPE, drop_value holds the name of the predicate or
102
102
// type to delete.
103
103
string drop_value = 5 ;
104
+
105
+ // run indexes in background.
106
+ bool run_in_background = 6 ;
104
107
}
105
108
106
109
// Worker services.
You can’t perform that action at this time.
0 commit comments