Couchbase Index Definition

Hi Team,

Is there any way can we get the index definition without logging into the Couchbase UI or is there any NQL query to get those details?

Thanks,
Debasis

Check the Index Management APIs.

With this API method we will get the name and params but I need the create statement so that I will run the through Query work bench.

Thanks,
Debasis

can we get the index definition without logging into the Couchbase UI

hmm…

but I need the create statement so that I will run the through Query work bench.

If you’re using the Query work bench, aren’t you already logged into the Couchbase UI?

Which API method?

https://www.google.com/search?q=couchbase+index+management+REST+API
first link.

– OR –

https://www.google.com/search?q=couchbase+index+management+java+sdk+API

Second link:

Search for “query index management”

Takes you to com.couchbase.client.java.manager.query (Couchbase Java SDK 3.5.0 API)

On that page, click on QueryIndexManager

getAllIndexes returns a list of QueryIndex, the raw json is available from the raw() method.

curl -s Administrator:password@127.0.0.1:9102/getIndexStatus |jq '.status[].definition' | sed 's/^"//g' | sed 's/"$/;/g' | sed 's/\\"/"/g'

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.