Actions7
- Document & Key-Value Actions
- Search Actions
Overview
This node performs full-text search queries on a Couchbase database using its Search service. It allows users to query a specified Couchbase search index and retrieve matching documents based on either a simple full-text query or an advanced raw JSON query. This is useful for scenarios where you need to perform complex text searches, filter results by specific fields, limit the number of returned documents, or include term location metadata in the results.
Practical examples:
- Searching product descriptions in an e-commerce catalog to find items matching user input.
- Retrieving documents containing specific keywords or phrases from a large dataset.
- Using advanced JSON queries to perform complex search criteria beyond simple text matching.
Properties
| Name | Meaning |
|---|---|
| Search Type | Type of search to perform. Currently supports "Couchbase Search Full Text" only. |
| Index Name | The name of the Couchbase search index to query. Can be selected from a list or entered manually. |
| Advanced Mode | Whether to use advanced mode to provide a raw JSON search query instead of a simple text query. |
| Search Query | (Simple mode) The full-text search query string to execute. |
| Fields to Return | (Simple mode) Comma-separated list of fields to return in the search results; * returns all fields. |
| Limit | (Simple mode) Maximum number of search results to return. |
| Include Locations | (Simple mode) Whether to include term location information in the search results. |
| Raw Search Query | (Advanced mode) A raw JSON object representing the search query to execute. |
Output
The output is a JSON array where each item corresponds to a search result document. Each item contains the fields requested (or all fields if * was specified). If no results are found, the output contains a single item with a message indicating "No results found".
If "Include Locations" is enabled, the search results also include metadata about the locations of matched terms within the documents.
The node does not output binary data.
Dependencies
- Requires a connection to a Couchbase cluster with appropriate credentials.
- Needs access to the Couchbase Search service and configured search indexes.
- The node depends on the Couchbase SDK and n8n's internal utilities for connecting and querying.
- Proper permissions must be granted to the API key or credentials used to access the bucket, scope, collection, and search indexes.
Troubleshooting
- No results found: If the search returns no matches, the output will contain a message indicating this. Verify that the search query and index name are correct and that the index contains data.
- Could not access collection error: Indicates issues with bucket, scope, or collection names or insufficient permissions. Ensure these exist and the credentials have access.
- Invalid JSON in Raw Search Query: When using advanced mode, the raw JSON query must be valid. Invalid JSON will cause errors.
- Index not found: If the specified index name does not exist, the search will fail. Confirm the index exists in Couchbase.
- Permission errors: Make sure the API key or credentials used have sufficient rights to perform search queries on the specified index.