Skip to main content

Understanding hybrid search

The need for hybrid search in retail

Customers often have specific needs that aren't easily captured by either pure keyword search or by pure semantic search. These needs can include personal preference, budget constraints and style - all requiring both the precision of keywords and the nuance of vectors:

Customer inquiry challenges

Customer inquiry challenges

In our online jeans store, merging vector search and traditional search allows us to utilize the strengths of both approaches. This integration is known as hybrid search; it combines the depth of vector search with the breadth of traditional search.

How Hybrid Search Works

All images/dataset used throughout this guide are from: Aggarwal, P. (2022). Fashion Product Images (Small). Available online: https://www.kaggle.com/datasets/paramaggarwal/fashion-product-images-dataset

Hybrid search operates by using a combined index that supports both dense vector embeddings and sparse textual data:

Hybrid search: sparse-sense indexing

Hybrid search: sparse-sense indexing

This enables it to leverage the context and nuance of vector search while retaining the comprehensive coverage of traditional search.

  • Adaptability: Hybrid search excels in scenarios where the dataset is limited or varies significantly, which is typical in fashion retail with constantly changing trends and styles

  • Precision and breadth: While vector search provides precision by understanding the context and nuances, traditional keyword search covers the breadth, ensuring no potential matches are missed even if they're only loosely related by text

User Experience

Hybrid search significantly enhances the user experience by delivering more relevant and personalized results. Understanding both the context and specific keywords in customer inquiries can present options that closely match user preferences.

Real-World Example

Consider a customer searching for "comfortable jeans for summer travel". A traditional keyword search might return all jeans labeled "comfortable" or "summer", while a vector search might focus on the concept of travel-friendly features.

Hybrid search would combine these aspects to recommend lightweight, comfortable jeans suitable for travel during the summer.

Technical Insight

Hybrid search algorithms balance vector and keyword components by assigning weights to each. The system can adjust these weights based on the nature of the query, the quality of the results, and user feedback.

For instance, in a fashion retail context, keyword importance might be increased for specific terms like "denim" or "stretch" while vector components capture broader concepts like style and fit.

By integrating these two approaches, hybrid search more effectively addresses a broader range of customer inquiries than either method alone.

Now that we have discussed traditional keyword search and vector search, let's explore how hybrid search works with our jeans data.