Skip to content

Search

Example showing how to search items with personalized full-text search.

This example assumes using Recombee; is in scope and apiKey contains your Recombee API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// Create an authenticated client
using var client = new RecombeeClient(apiKey);
var databaseId = GetDatabaseId();

// Search items with personalized full-text search
var response = await client.Search.CreateByDatabaseIdSearchUsersByUserIdItemsAsync(
    databaseId: databaseId,
    userId: "test-user-1",
    searchQuery: "laptop",
    count: 5,
    cascadeCreate: true,
    returnProperties: true);

// The response contains a recommendation ID and ranked search results