A newer version of this documentation is available.

View Latest

Run A Simple Search with the Web Console

  • how-to
    +
    Run a Search query from the Couchbase Server Web Console to preview the search results from a Search index.

    Prerequisites

    • You have the Search Service enabled on a node in your database.

    • Your user account has the Search Admin or Search Reader role.

    • 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 Server Web Console.

    Procedure

    To run a simple search with the Couchbase Server Web Console:

    1. Go to Search.

    2. Click the index or index alias where you want to run a search.

    3. In the Search this index field, enter a search query.

      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.
    4. Press Enter or click Search.

    5. (Optional) To view the contents of a document, click the document name in the search results list.

    Next Steps

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