Vector Space

A vector space represents text or products as points in multi-dimensional space. It lets search engines compare queries and items by measuring distances.

What is a Vector Space?

A vector space is a mathematical model where items (words, documents, or products) are represented as vectors (lists of numbers). In search, this allows engines to calculate similarity between a query and documents using metrics like cosine similarity or dot product.

How It Works (quick)

  • Representation: Each document/query → vector of term weights (TF-IDF, embeddings).
  • Similarity: Compute cosine similarity (angle) or Euclidean distance.
  • Indexing: Store vectors in specialized databases (e.g., FAISS, Pinecone).
  • Hybrid search: Combine vector scores with keyword ranking (BM25).

Why It Matters in E-commerce

  • Semantic search: Matches intent beyond exact keywords (“joggers” ↔ “sweatpants”).
  • Personalization: Shopper profiles as vectors matched with products.
  • Cross-language: Vectors allow matching queries across languages.

Best Practices

  • Normalize vectors to unit length for cosine similarity.
  • Use domain-tuned embeddings for catalog language.
  • Combine with filters and facets for precision.
  • Monitor drift: embeddings may age as catalog or language changes.

Summary

Vector spaces power semantic and hybrid search. They help shoppers find products even when they don’t use exact catalog terms.

See these concepts in action: semantic, typo-tolerant search for Shopify stores — implemented by Rapid Search