Creating Index Alias
A Full Text Index Alias can be created for on one or more indexes or aliases. Aliases support the same search query as FTS indexes. Search request on an alias simply aggregate all of the results from individual FTS index scans and return to the application. Aliases are useful for two things: searching across multiple collections or buckets, index maintenance.
An index alias points to one or more Full Text Indexes index aliases: its purpose is comparable to a symbolic link in a computer filesystem. Queries on an index alias are performed on all underlying indexes, and the results from each scan are combined before returning the result to the application.
The use of index aliases permits applications refer to a placeholder (the alias-name) that never changes, leaving administrators free periodically to change the identity of the real index pointed to by the alias. This may be particularly useful when an index needs to be updated: to avoid down-time, while the current index remains in service, a clone of the current index can be created, modified, and tested. Then, when the clone is ready, the existing alias can be retargeted so that the clone becomes the current index; and the (now) previous index can be removed.
The following process explains how to create an index alias in Couchbase:
On the Couchbase Web Console’s left pane, click Search. The Full Text Aliases panel is shown at the bottom of the page.
Now, click + Add Alias to add new alias. The Add Alias page opens.
Now, let’s create an alias named travelSampleIndexesAlias containing two indexes: travel-sample-index-stored and travel-sample-index-unstored. In the Add Alias page, add the alias name in the Index Name field. Then select one or more indexes to add from the Target Indexes list. The selected index is highlighted in a separate color.
Finally, click Create Index Alias. The new index alias is added to the list in the Full Text Aliases panel.