Import a Search Index Definition with the Capella UI

  • how-to
    +
    Use the Couchbase Capella UI to import a JSON Search index definition or Search index alias.

    Prerequisites

    • You have the Search Service enabled on a node in your database. For more information about how to change Services on your database, see Modify a Database.

    • You have a bucket with scopes and collections in your database. For more information, see Manage Buckets.

    • You have a Search index or Search index alias definition saved as a JSON file. For more information about the properties you can include in a Search index or index alias definition, see Search Index JSON Properties.

      Your JSON file must be smaller than 40 MB.
    • You have logged in to the Couchbase Capella UI.

    Import a Search Index Definition

    To import a full Search index definition with the Capella UI:

    1. On the Databases page, select the database where you want to import a JSON Search index definition.

    2. Go to Data Tools  Search.

    3. Click Create Search Index.

    4. Click Advanced Mode.

    5. Click Index Definition.

    6. Click Import from File.

    7. Upload a JSON file that contains your Search index definition.

      For example:

      {
          "type": "fulltext-index",
          "name": "travel-sample.inventory.travel-index",
          "uuid": "2c4b22c60b59c524",
          "sourceType": "gocbcore",
          "sourceName": "travel-sample",
          "sourceUUID": "76a82f1f3471d9fae3b483f9ee75459d",
          "planParams": {
            "maxPartitionsPerPIndex": 1024,
            "indexPartitions": 1
          },
          "params": {
            "doc_config": {
              "docid_prefix_delim": "",
              "docid_regexp": "",
              "mode": "scope.collection.type_field",
              "type_field": "type"
            },
            "mapping": {
              "analysis": {},
              "default_analyzer": "standard",
              "default_datetime_parser": "dateTimeOptional",
              "default_field": "_all",
              "default_mapping": {
                "dynamic": false,
                "enabled": false
              },
              "default_type": "_default",
              "docvalues_dynamic": false,
              "index_dynamic": false,
              "store_dynamic": false,
              "type_field": "_type",
              "types": {
                "inventory.airline": {
                  "dynamic": false,
                  "enabled": true,
                  "properties": {}
                }
              }
            },
            "store": {
              "indexType": "scorch",
              "segmentVersion": 15
            }
          },
          "sourceParams": {}
        }
    8. (Optional) Make changes to your Search index settings.

    9. Click Create Index.

    Import a Search Index Alias Definition

    To import a Search alias with the Capella UI:

    1. On the Databases page, select the database where you want to import a JSON Search index alias.

    2. Go to Data Tools  Search.

    3. Click Create Search Alias.

    4. Click Alias Definition.

    5. Click Import from File.

    6. Upload a JSON file that contains your Search alias definition.

      For example:

      {
          "name": "travel-color-index",
          "type": "fulltext-alias",
          "params": {
            "targets": {
              "travel-sample.inventory.travel-index": {},
              "vector-sample.color.color-index": {}
            }
          },
          "sourceType": "nil",
          "sourceName": "",
          "sourceUUID": "",
          "sourceParams": null,
          "planParams": {},
          "uuid": "",
          "id": ""
        }
    7. (Optional) Make changes to your Search index alias settings.

    8. Click Create Alias.

    Next Steps

    To add additional features to your imported Search index, see Search Index Features.

    To run a search with your Search index or index alias, see Run A Simple Search with the Capella UI.