# Vector Search: What It Is and What It Changes in Your Store

> What vector search is, how it finds products by similarity with embeddings, why it fails on a SKU and what Google's hybrid search adds.

URL: https://clione.ai/glossary/vector-search/
Lang: en

A customer types "something to take steady photos at night" into a camera store's search box and gets tripods, even though no [product page](/glossary/product-page/) says "night" or "steady". Vector search may be behind it: **instead of comparing words, it compares numbers that represent what each text means**. It has nothing to do with vector graphics or searching for SVG images. It matters to a store twice over: it may be behind the search on your own site, and it is one of the pieces an assistant uses to find the pages it then cites.

## How it works

The job has three steps. First, a model turns each text in the catalog into a vector, a list of numbers: Google describes it as a type of vector that represents data in a way that **captures its semantic meaning**.[^vertex-overview] Those vectors are [_embeddings_](/glossary/embeddings/), and their entry explains how the distance between two is measured. Second, the vectors are stored in an index. Third, when a query arrives, it is turned into a vector with the same model and the closest vectors are looked up. OpenAI lists search as the first use of its _embeddings_: results are ranked by how related they are to the query text.[^openai-embeddings]

The second step is what sets vector search apart from a simple comparison. With millions of products, comparing the query against every vector, one by one, is slow. So systems look for **approximate nearest neighbors**: they accept not guaranteeing the exact closest one in exchange for answering fast. One well-known method is HNSW, published by Yu. A. Malkov and D. A. Yashunin in 2016, which organizes the vectors into several layers of proximity graphs and makes the cost of a search grow logarithmically with the size of the collection.[^hnsw] Google's Vector Search service uses another algorithm, ScaNN, developed by Google Research, and cites among its uses ecommerce recommendations and [RAG (retrieval-augmented generation)](/glossary/rag/), with eBay and Mercari as examples.[^vertex-overview]

There is a practical limit before you start: the text has to fit in the model. OpenAI's _embeddings_ models accept at most 8,192 [tokens](/glossary/token/) per input,[^openai-embeddings] so a long document is split into chunks and each chunk gets its own vector.

### Where it fails, and hybrid search

Vector search finds by similarity of meaning, and that has a flip side. Google Cloud's documentation says it with store examples: arbitrary product numbers or [SKUs](/glossary/sku/), the names of products that were just added and internal code names **do not work with [semantic search](/glossary/semantic-search/), because they were not in the data the _embeddings_ model was trained on**.[^vertex-hybrid] A code like "TV-200-BK" means nothing to the model: it is a string of characters.

The usual fix is to mix two kinds of vector. Google distinguishes dense _embeddings_, which represent the meaning of the text, from sparse ones, which represent its syntax and work like a keyword search.[^vertex-overview] **Hybrid search uses both** and merges the two result lists with a method called _Reciprocal Rank Fusion_: each result earns points according to its position in each list, so whatever ranks high in both comes first. A parameter decides how much each side weighs, from dense vectors only to keywords only.[^vertex-hybrid]

## In a store

A **fictional example**: the internal search of a camera store, with three queries. The last column applies what Google Cloud's documentation says about each method.[^vertex-hybrid]

| Query                                             | Keywords only                                 | Vector search only                                      | Hybrid search                              |
| ------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------- | ------------------------------------------ |
| "something to take steady photos at night"        | Few results: the pages do not use those words | Tripods and stabilizers, by similarity of meaning       | Tripods and stabilizers                    |
| "TV-200-BK", the code the manufacturer gives      | The page that contains that code              | Risk of missing it: the code means nothing to the model | The exact page, thanks to the keyword side |
| The name of a range the brand launched this month | Finds it if the page spells it out            | Risk of confusing it with something similar             | Finds it                                   |

Platforms already offer it. Since June 24, 2024, Shopify stores on the Shopify and Advanced plans can turn on semantic search in the Search & Discovery app, which understands that someone searching for "something to wear in summer" wants a pair of shorts;[^shopify-semantic] the announcement does not detail the technique it uses inside. Clione, for example, computes a vector for each product and lets you search the catalog by meaning while filtering at the same time by status, brand and availability.

The lesson for the catalog is twofold. **The vector can only represent what your text says**, so the description has to name the use, the material and the situation in plain words. And codes, the [SKU](/glossary/sku/), the [MPN](/glossary/mpn/) or the [GTIN](/glossary/gtin/), have to sit in fields the keyword side can match as they are.


That vector search replaces keyword search, and that turning it on improves every query. Google Cloud explains that each method fails where the other succeeds, that a SKU or a newly created name does not work with semantic search and that this is why hybrid search exists, **better than either one alone**.[^vertex-hybrid]


## How to check it

1. **Search your store for a need, not a product**, using words your product pages do not use. If nothing useful comes up, your search is not comparing by meaning.
2. **Search for an exact SKU and a manufacturer code.** If the product page does not appear, the search is not combining the keyword side or that code is not indexed.[^vertex-hybrid]
3. **Search for the name of a product you added this week.** It is the other case Google flags as weak for vectors.[^vertex-hybrid]
4. **Check that the description is text and not an image**, and that a very long text gets chunked: the _embeddings_ model has a maximum number of tokens per input.[^openai-embeddings]
5. **Review the searches with no results** in your internal search's report, if it has one: those are the queries neither words nor vectors solved.

## Related concept: semantic search

[Semantic search](/glossary/semantic-search/) is the goal, finding by meaning; vector search is one of the techniques for getting there. Google presents its Vector Search as an engine for semantic similarity searches,[^vertex-overview] but its own documentation shows the best result comes from **mixing vectors with the same old words**.[^vertex-hybrid]

To go further, the [_embeddings_](/glossary/embeddings/) entry explains what vectors are and how their distance is measured, and the [reading path](/learn/ai-search/) orders the rest of the terms.
