Run A Simple Search with the Capella UI

  • how-to
    +
    Run a Search query from the Couchbase Capella UI to preview the search results from a Search index.

    For more information about how the Search Service scores documents in search results, see Scoring for Search Queries.

    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 created a Search index.

      For more information about how to create a Search index, see Create a Search Index.

    • You have logged in to the Couchbase Capella UI.

    Procedure

    To run a simple search with the Capella UI:

    1. On the Databases page, select the database where you created your Search index.

    2. Go to Data Tools  Search.

    3. Next to your Search index or index alias, click Search.

    4. In the Search field, enter a search query.

    5. Press Enter.

    6. (Optional) To view a document and its source collection, click a document name in the search results list.

    Example

    For example, the following query searches for the strings view, food, and beach:

    {
        "explain": true,
        "fields": [
          "*"
        ],
        "highlight": {},
        "query": {
          "query": "+view +food +beach"
        },
        "size": 10,
        "from": 0
    }

    The query payload enables scoring explanations and term highlighting. It also returns all available fields in the index, and returns 10 results per page.

    Use a Search index alias to search multiple Search indexes in a single search query. Use the collections parameter in your request to specify an array of collections to search from the Search index.

    Next Steps

    If you do not get the search results you were expecting, you can change the JSON payload for your Search query.

    You can also Search Index Features.