Full-text search instincts about filters don’t translate to vector search

In full-text search, the rule has been to filter before ranking. Make results more precise while speeding up search.

While filters do improve precision, they don’t speed up graph based vector search: in fact search gets slower.

Navigating vector spaces is like navigating a map. Except in more dimensions. You want to find nearest neighbors to an address? OK, it’s not hard to build a data structure that says “Here’s Doug’s house and 10 nearby neighbors”.

But typical search is different. You frequently say “I want 10 of Doug’s neighbors, but only blue houses”. Well, you break the data structure. You need to explore neighbors, and neighbors-of-neighbors, gathering houses until you get 10 nearby blue neighbors.

So be careful — adding a filter can vector search slower! More conditions, deeper graph traversal.

-Doug

This is part of Doug’s Daily Search tips - subscribe here


Enjoy softwaredoug in training course form!

Starting June 22!

I hope you join me at Cheat at Search with LLMs to learn how to apply LLMs to search applications. Check out this post for a sneak preview.

Doug Turnbull

More from Doug
Twitter | LinkedIn | Newsletter | Bsky
Take My New Course - Cheat at Search with LLMs