A newer version of this documentation is available.

View Latest

Create a Child Field

  • how-to
    +
    Create a child field with the Couchbase Server Web Console to add or remove a specific field’s content from a Search index.

    Prerequisites

    Procedure

    To add or remove a child field from a Search index with the Couchbase Server Web Console:

    1. Go to Search.

    2. Click the index where you want to create a child field.

    3. Click Edit.

    4. Expand Customize Index  Mappings.

    5. Point to an existing mapping and click +.

    6. Click insert child field.

    7. In the Field field, enter the name of a field in your documents that you want to add or remove from the index.

      The field must contain either a single value or an array. If the field contains a JSON object, Create a Child Mapping, instead.
    8. In the Type list, select the data type for the field.

      For more information about the available data types, see Field Data Types.

    9. Configure optional settings for the child field:

      Option Description

      Searchable As

      Set a different name that you can use to search the field’s contents in a query.

      The default value is the value set in Field.

      Analyzer

      Choose an analyzer for the content in the child field.

      You can choose a default analyzer or a custom analyzer.

      For more information about the available default analyzers, see Default Analyzers.

      For more information about how to create a custom analyzer, see Create a Custom Analyzer.

      Index

      To include the child field in the index, select Index.

      To remove the child field from the index, clear Index.

      Store

      To store the values from the field in the index and return them in search results, select Store. This increases your index’s size and indexing time.

      To remove the field’s values from the index, clear Store.

      Include in _all field

      The _all field is a composite field that has the content from multiple fields in an index. It allows searches to query the content of a field without specifying the field’s name.

      To include this field in the _all field, select Include in _all field.

      To exclude this field from the _all field, clear Include in _all field.

      To change the name of the _all field, see Default Field.

      Include Term Vectors

      Term vectors store the location of terms in a field for an index. You can use term vectors to highlighting matching search terms in search results, and perform phrase searches. Term vectors increase your index’s size and indexing time.

      To enable term vectors for this field, select Include Term Vectors.

      To turn off term vectors, clear Include Term Vectors.

      To enable term vectors, you must also enable Store.

      Doc Values

      Doc values are the value for each instance of the field in an index. Use doc values for Search Facets and sorting search results.

      To store doc values, select Doc Values.

      To exclude doc values from the index, clear Doc Values.

    10. Click OK.

    Next Steps

    You can continue to create child fields to add or remove the contents of a document from your Search index.

    If a field in your documents contains a JSON object, Create a Child Mapping, instead.

    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.