Skip to main content

Overview

Text search combines semantic text understanding with visual similarity to find relevant products. Use the visualWeight parameter to balance between text matching and visual similarity.

Basic Usage

Parameters

string
required
The search query. Natural language queries like “summer dress for wedding” work best.
number
required
Number of results to return. Recommended: 12-48 for grid layouts.
number
default:"0.3"
Balance between text and visual search (0.0 to 1.0).
  • 0.0 = Pure text matching
  • 1.0 = Pure visual similarity
  • 0.3 = Text-primary with visual boost (default)
Filter[]
Array of filters to apply. See Filters for operators.
SortBy
Sorting configuration with field and order (‘ascending’ | ‘descending’).

With Filters and Sorting

Response

SearchResultItem[]
Array of matching products, ordered by relevance.
FilterOption[]
Available filter values based on the result set. Useful for building faceted navigation.
string
Unique identifier for this search serve. Used internally for event tracking.
number
Total number of matching products (before topK limit). Use for pagination UI.

Tracking Search Results

Always track search results to power analytics and improve recommendations:
See Event Tracking for more details.

Visual Weight Recommendations

The optimal visualWeight depends on your product category:
A/B test different visual weights to find the optimal balance for your specific catalog and user behavior.

Pagination

Use topK with offset for pagination:
For best performance, prefer “Load More” patterns over traditional pagination. Each new search request is independent and provides fresh relevance scoring.

Error Handling

Complete Example

Next Steps

Image Search

Search using uploaded images

Filters

Filter operators reference