Vector Databases for Embeddings with Pinecone
James Chapman
Curriculum Manager, DataCamp
{
"genre": "action",
"year": 2020,
"color": "blue",
"fit": "straight",
"price": 29.99,
"is_jeans": true,
"areas": ["London", "Kent", "Bath"]
}
index.query( vector=[-0.250919762305275, ...],
filter={
"genre": {"$eq": "documentary"}, "year": 2019
},
top_k=1 )
$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)index.query( vector=[-0.250919762305275, ...],
filter={
"year": {"$gt": 2019},
},
top_k=1,
include_metadatas=True
)
{'matches': [{'id': '1', 'score': 0.0478537641,
'values': [],
'metadata': {'genre': 'action', 'year': 2020}}],
'namespace': '',
'usage': {'read_units': 5}}
Vector Databases for Embeddings with Pinecone