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:
-
Go to Search.
-
Click the index or index alias where you want to run a search.
-
In the Search this index field, enter a search query.
For example, the following query searches for the strings
view
,food
, andbeach
:{ "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. -
Press Enter or click Search.
-
(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.
You can also Customize a Search Index with the Web Console.