Overview
Text search combines semantic text understanding with visual similarity to find relevant products. Use thevisualWeight 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 matching1.0= Pure visual similarity0.3= Text-primary with visual boost (default)
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:Visual Weight Recommendations
The optimalvisualWeight depends on your product category:
Pagination
UsetopK 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