A newer version of this documentation is available.

View Latest

Creating Index from UI

      +

      The user interface for Full Text Search is provided by the Couchbase Web Console. To proceed, you must have permission to log into the console, create indexes, and perform searches. For information on Role-Based Access Control, see Authorization.

      The example provided in this section assumes that you have also loaded the travel-sample bucket: you will perform your Full Text Search operations on the data in this bucket. For instructions on how to load this sample bucket, see Sample Buckets.

      Once you have the appropriate credentials and have loaded the travel-sample bucket, access the Couchbase Web Console by typing http://localhost:8091 into the address field at the top of your browser and then hitting return.

      The login screen appears as follows:

      fts login screen

      Enter your username and password, and left-click the Sign In button. The Couchbase Web Console now appears, with the Dashboard for the cluster displayed:

      fts console initial
      The appearance of the main panel of the Dashboard varies in accordance with customizations that have been performed. For information, see Manage Statistics.

      To access the Full Text Search screen, left-click on the Search tab in the navigation bar on the left-hand side:

      fts select search tab

      The Full Text Search screen now appears as follows:

      fts fts console initial

      The console contains areas for displaying indexes and aliases: but both are empty since none has yet been created.

      Quick Index

      Quick Index/Editor is a new interface in FTS where you can quickly select the bucket, scope, and collection and choose the fields to index from the searched documents.

      This highly visual interface allows you to easily select a minimal set of fields to index. Due to this, the search query performance will be optimized as it has to handle fewer fields, decreasing the query latency.

      To create a quick index, left-click on the QUICK INDEX button, located on the upper right of the Search UI:

      The QUICK INDEX screen appears:

      fts quick index screen

      To define a basic index on which Full Text Searches can be performed:

      • Enter a unique name for the index into the Index Name field, on the upper-left: for example, travel-sample-index. (Note that only alphanumeric characters, hyphens, and underscores are allowed for index names and the first character of the name must be an alphabetic character.)

      • Use the pull-down menus provided for the Keyspace fields, at the upper-right, to specify as follows:

      fts quick index name and bucket

      Example:

      fts quick editor create index
      • The user can continue to randomly pick documents via the circular refresh symbol until they find a document of their intended type/schema. It is also possible to have multi-schema documents within a collection.

      • Select the required field from the document, which is needed to be mapped to this index. Once the field is selected, the configuration panel is displayed on the right.

      • Select the related type of the field from the Type dropdown. After that, select the required language for the chosen field.

        • For type "text", you can select Index this field as an identifier to index the identifier values precisely without any transformation; for this case, language selection is disabled.

      • Furthermore, the following additional configurations may be applied so that the search can be more personalized:

        • Include in search results: Select this option to include the field in the search result.

        • Support highlighting: Select this option to highlight the matched field. For this option, you must also select the Include in search result option.

        • Support phrase matching: Select this option to match the phrases in the index.

        • Support sorting and faceting: Select this option to allow sorting and faceting the index.

      • Click Add and the selected field will be indexed and can be searched upon while querying. Finally, click on the Create Index button to save the index. NOTE: Selecting configuration options requires additional storage and makes the index size larger.

      Quick editor

      To quick edit an index, left-click on the Quick Edit button towards the right-hand side of an existing Index on the Full Text Indexes panel.

      The Quick Edit screen appears:

      fts quick edit screen

      Example:

      fts quick editor edit index
      • Quick Edit allows you to modify and delete the configured mapped fields with the same index. To delete the mapped fields, select the field from the Mapped Fields grid and click Delete.

      • To map the new fields, select the field from the JSON format document, change the configuration and click Add.

      • To modify the mapped fields, select the field from the Mapped Fields, change the configuration and click Update.

      • To save your changes in the quick index, left-click on the Update Index button near the bottom of the screen.

      Document Refresh/Reselection option

      The 'Refresh' option will randomly select a document from the given Keyspace (bucket.scope.collection).

      fts quick editor refresh reselection

      Once the configuration is completed for the selected fields, click Add/Update. Mapped fields will display the updated columns and each entry will indicate the configurations for the field.

      This is all you need to specify in order to create a basic index for test and development. No further configuration is required.

      Note, however, that adding extra fields that are not required is not recommended for production environments since it creates indexes that may be unnecessarily large, and therefore insufficiently performant. To review the wide range of available options for creating indexes appropriate for production environments, see Configure Indexes.

      At this point, you are returned to the Full Text Search screen. A row now appears, in the Full Text Indexes panel, for the quick index you have created. When left-clicked on, the row opens as follows:

      fts new quick index progress
      The percentage figure appears under the indexing progress column, and is incremented in correspondence with the build-progress of the index. When 100% is reached, the index build is said to be complete. Search queries will, however, be allowed as soon as the index is created, meaning partial results can be expected until the index build is complete.

      Once the new index has been built, it supports Full Text Searches performed by all available means: the Console UI, the Couchbase REST API, and the Couchbase SDK.

      If one or more of the nodes in the cluster running data service go down and/or are failed over, indexing progress may show a value > 100%.