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.
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 deploy a new node and Services on your database, see Manage Nodes and Clusters.
-
You have a bucket with scopes and collections in your database. For more information about how to create a bucket, see Create a Bucket.
-
You have created a Search index.
For more information about how to create a Search index, see Create a Search Index.
-
Your user account has the Search Admin or Search Reader role.
-
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 where you want to run a search.
-
In the Search this index field, enter a search query.
-
Press Enter or click Search.
-
(Optional) To view the full contents of a document returned in the search results, click one of the results.
-
(Optional) To view the results of document scoring in search results, click Show Scoring.
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 Customize a Search Index with the Web Console.