Create a Typesense collection with a product schema and implement hybrid vector + keyword search for ecommerce

domain: typesense.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a collection via POST /collections with a schema that includes standard string/int32 fields (title, brand, price, in_stock) and an auto-embedding field configured with an embed.from list of source fields and an embed.model_config pointing to an embedding model (e.g., openai/text-embedding-3-small); the num_dim must match the model's output dimensionality.
  2. Index product documents via POST /collections/{collection}/documents (single) or POST /collections/{collection}/documents/import?action=upsert (bulk JSONL); Typesense generates the embedding vector automatically at index time.
  3. Issue a hybrid search by setting query_by to a comma-separated list of both regular fields and the embedding field in a single search request; Typesense performs keyword search on text fields and vector search on the embedding field, merging results via Rank Fusion.
  4. Tune the hybrid balance using the alpha parameter in vector_query (0.0 = pure vector, 1.0 = pure keyword; default vector weight is 0.3); adjust based on your catalogue's natural-language vs. attribute query mix.
  5. In v30+, Curation Sets (formerly per-collection Overrides) and Synonym Sets are top-level resources; attach a Curation Set to a collection via its collection binding. If upgrading from v29 or earlier, synonym and curation data is auto-migrated but API key ACLs may need updating (synonym:* → synonym_sets:*).

Known gotchas

Related routes

Implement commercetools product type and attribute schema migration with backward-compatible rollout across multiple regions
commercetools product type management · 6 steps · unrated
Implement Product structured data to qualify for merchant listing and price drop rich results
schema-org · 5 steps · unrated
Implement commercetools product type schema with complex nested attributes and migrate attribute definitions without breaking existing product data
commercetools.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans