Create a Custom Date/Time Parser

  • Capella Operational
  • how-to
    +
    Create a custom date/time parser with the Couchbase Capella UI to tell the Search Service how to process a new date/time format.

    If you store date data in a format other than RFC-3339 (ISO-8601), then you need to create a date/time parser.

    Prerequisites

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

    • You have logged in to the Couchbase Capella UI.

    • You have started to create or already created an index in Advanced Mode Editing.

    Procedure

    To create a custom date/time parser with the Capella UI in Advanced Mode:

    1. On the Operational Clusters page, select the operational cluster where you want to work with the Search Service.

    2. Go to Data Tools  Search.

    3. Do one of the following:

      1. To work with an existing Search index, click the name of the index where you want to create a custom date/time parser.

      2. To create a new Search index, click Create Search Index.

    4. Make sure to select Enable Advanced Options.

    5. Expand Global Index Settings.

    6. Click Add Custom Date/Time Parser

    7. In the Date/Time Parser Name field, enter a name for the date/time parser.

    8. In the New Date and Time field, enter a date/time layout with Go syntax.

      For more information, see the documentation about the Go Programming Language Time Package’s Layout Constant.

    9. (Optional) To add an additional layout, click Add and enter a new layout.

    10. Click Add Custom Date/Time Parser.

    Next Steps

    After you create a custom date/time parser, you can set it as the default date/time parser for your Search index.

    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 Capella UI.