File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,20 @@ Operation operation = Operation.newBuilder().setSchema(schema).build();
161161dgraphClient. 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
165179drop all. Drop all is useful if you wish to discard all the data, and start from
166180a clean slate, without bringing the instance down.
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments