Shmuly Itzkowitz
04/01/2025, 7:43 PMconst semanticSearchParams = {
collection: 'products',
q: query.toLowerCase(), // Ensure this contains the search term
query_by: 'sku,product_name, description',
query_by_weights: '8,4,2', //ioritize product_name over SKU
sort_by: '_text_match:desc', // Ensures keyword matches come first
vector_query: `embedding:([${queryVector}], k:100, distance_threshold:0.6, alpha:0.7)`,
exclude_fields: 'embedding',
group_by: 'parent_id',
group_limit: 1,
per_page: 6, // Slightly increase for better results
};