Skip to content

Instantly share code, notes, and snippets.

@kveber
Created October 18, 2022 01:16
Show Gist options
  • Save kveber/55f1528bdcceecea7b278c1e26408f60 to your computer and use it in GitHub Desktop.
Save kveber/55f1528bdcceecea7b278c1e26408f60 to your computer and use it in GitHub Desktop.
Rebuild All Couchbase N1QL Indexes After Restore
-- Note: Extra () around subquery is needed make it expression. i.e one () for BUILD index syntax and other() for subquery.
BUILD INDEX ON default((SELECT RAW name FROM system:indexes WHERE keyspace_id = 'default' AND state = 'deferred'));
-- Wait few secs finish build index and see if build is complete.
SELECT RAW name FROM system:indexes WHERE keyspace_id = 'default' AND state = 'deferred' ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment