Neeraj Krishna
Neeraj Krishna

Reputation: 1615

Any impact of changing the index in cloudant

I have cloudant database with some already populated documents in use... I'm using a cloudant java client to fetch data from that. I plan to change the indexes that are used currently. Basically I plan to change over from using createIndex() to https://github.com/cloudant/java-cloudant#cloudant-search. Also would like to change the fields on which the documents are indexed.

Would changing the index impact the underlying data or cause any migration issues with existing data when I start to use the new Index?

Upvotes: 0

Views: 147

Answers (1)

Mike Rhodes
Mike Rhodes

Reputation: 1836

It sounds like you want to change from using Cloudant Query to Cloudant Search. This should be straight forward and safe.

Adding a new index will not change or affect the existing data -- the main thing to be careful of is not deleting your old index before you've migrated your code. The easiest way to do this is by using a new design document for your new search indexes:

  1. Create a new design document containing your search index and upload it to Cloudant (https://github.com/cloudant/java-cloudant#creating-a-search-index).
  2. Migrate your app to use the new search index.
  3. (Optionally) remove the design document containing the indexes that you no longer need. Cloudant will then clean up the index files that are no longer needed (https://github.com/cloudant/java-cloudant#comcloudantclientapidatabaseremovedoc-idrev-id).

I included links to the relevant parts of the Java API, but obviously you could do this through the dashboard.

Upvotes: 0

Related Questions