Create an XATTRs Mapping

  • how-to
    +
    Use the Server Web Console to create a mapping for Extended Attributes (XATTRs) and search for them with the Search Service, on Couchbase Server version 7.6.2 and later.

    You must add an XATTRs mapping to your Search index to use and search for XATTRs metadata in your documents.

    Prerequisites

    • Your database is running Couchbase Server version 7.6.2 or later.

    • You have the Search Service enabled on a node in your database. For more information about how to deploy a new node and Services on your database, see Manage Nodes and Clusters.

    • You have created an index. For more information, see Create a Basic Search Index with the Web Console.

    • You have created a type mapping for a collection. For more information about how to create a type mapping on an index, see Create a Type Mapping.

    • You have logged in to the Couchbase Server Web Console.

    Procedure

    To add an XATTRs mapping to your Search index from the Server Web Console:

    1. Go to Search.

    2. Click the index where you want to create an XATTRs mapping.

    3. Click Edit.

    4. Expand Customize Index  Mappings.

    5. Point to an existing collection type mapping and click +.

    6. Click insert xattrs mapping.

    7. (Optional) To only index the fields you add to the XATTRs mapping, select only index specified fields.

      Otherwise, your XATTRs mapping is a dynamic mapping that includes all child fields from your documents' metadata.

    8. (Optional) To set a different analyzer for the XATTRs mapping, in the Analyzer list, select an analyzer.

      You can select a default analyzer or create your own.

    9. Click OK.

    Next Steps

    After you create a XATTRs mapping, you can choose to add or remove fields in your document metadata from your Search index.

    XATTRs mappings, child mappings, and type mappings use child fields to add and remove fields from a Search index.

    For more information about how to add or remove fields from a mapping, see Create a Child Field.

    To continue customizing your Search index, you can also:

    To run a search and test the contents of your Search index, see Run A Simple Search with the Web Console or Run a Simple Search with the REST API and curl/HTTP.