From: jkatz (@jkatz) <noreply+jkatz@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #259: Understanding HNSW + filtering
Date: Sun, 17 Sep 2023 19:13:43 +0000
Message-ID: <gh-pgvector-pgvector-259-c1722545663@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-259@github.com>
References: <gh-pgvector-pgvector-259@github.com>
@knizhnik It may expand the search radius, but we may not be seeing the best available vectors for a filter. For example, let's say that vectors with a specific filter (`category_id=5`) are clustered around a particularly neighborhood that's not actually close to the query vector -- if we expand the search, we may end up exhaustively searching the index until we find the best candidate vectors.
I don't know how much of an issue it would be in practice, but I still think it makes sense to try to tailor the search path towards vectors that are known to match a particular filter. Maybe after that it could make sense to expand the search radius if we're not finding enough vectors, but I'd need to think on it some more.