Recombee SearchItem Segments icon

Recombee SearchItem Segments

SearchItemSegments operation from Recombee

Overview

This node performs search operations on item segments using the Recombee recommendation API. It allows users to query item segments based on a search string and user context, returning a list of matching items with various filtering and boosting options.

Common scenarios where this node is beneficial include:

  • Personalized product or content recommendations based on user behavior.
  • Searching for items within specific segments or categories tailored to a user.
  • Enhancing search results by applying custom filters, boosters, and logic rules.

Practical example:

  • An e-commerce platform wants to recommend products to a user based on their recent searches and preferences. This node can be used to query item segments relevant to that user, applying filters like category or price range, and boosting certain attributes to prioritize featured products.

Properties

Name Meaning
Query The search string to find matching item segments.
User ID The identifier of the user for whom the search is performed.
Count The maximum number of items to return in the search result.
Scenario Optional scenario name to customize the search context.
Cascade Create Whether to create the item if it does not exist in the database (true/false).
Filter Optional filter expression to narrow down the search results.
Booster Optional booster expression to influence the ranking of search results.
Logic JSON object defining additional logical conditions to apply to the search.
Max Retries Number of times to retry failed batch requests before failing.
Timeout (Ms) Request timeout duration in milliseconds for each API call.

Output

The node outputs an array of JSON objects, each representing the result of a search operation for an input item. Each output object contains:

  • success: Boolean indicating whether the search was successful.
  • searchResult: The detailed search result returned by the Recombee API for the corresponding query.
  • Input parameters echoed back such as userId, query, count, scenario, filter, booster, and logic.
  • In case of failure, an error field describing the error message.

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Recombee service.
  • Needs configuration of the Recombee database ID, private token, and region.
  • Uses the official Recombee API client library (recombee-api-client) bundled with the node.
  • The node respects a configurable request timeout and supports retrying failed batch requests.

Troubleshooting

  • Empty Query Error: If the "Query" property is empty, the node throws an error stating that the query cannot be an empty string. Ensure the query string is provided.
  • API Errors: If the Recombee API returns errors for individual batch requests, the node either continues processing (if "Continue On Fail" is enabled) or throws an error. Check the error messages for details.
  • Timeouts: Requests may fail if the configured timeout is too low. Increase the "Timeout (Ms)" property if you experience frequent timeouts.
  • Retries: Batch requests are retried up to the configured "Max Retries" count. If failures persist beyond retries, verify network connectivity and API credentials.
  • Credential Issues: Ensure that the API key credential and database information are correctly set up in n8n.

Links and References

Discussion