You can limit your vector search based on metadata. Pinecone lets you attach metadata key-value pairs to vectors in an index, and specify filter expressions when you query the index.
$eq
- Equal to (number, string, boolean)$ne
- Not equal to (number, string, boolean)$gt
- Greater than (number)$gte
- Greater than or equal to (number)$lt
- Less than (number)$lte
- Less than or equal to (number)$in
- In array (string or number)$nin
- Not in array (string or number)$exists
- Has the specified metadata field (boolean)"genre"
takes on both values.
For example, queries with the following filters will match the vector:
include_metadata
flag so that vector metadata is included in the response.
top_k>1000
. Queries with top_k
over 1000 should not containinclude_metadata=True
or include_data=True
.gcp-starter
region do not support deleting by metadata.
Example
This example deletes all vectors with genre “documentary” and year 2019 from an index.
Python JavaScript curl