langchain/tests/integration_tests/vectorstores
HenriZuber e0605b464b
feat: faiss filter from list (#6537)
### Feature

Using FAISS on a retrievalQA task, I found myself wanting to allow in
multiple sources. From what I understood, the filter feature takes in a
dict of form {key: value} which then will check in the metadata for the
exact value linked to that key.
I added some logic to be able to pass a list which will be checked
against instead of an exact value. Passing an exact value will also
work.

Here's an example of how I could then use it in my own project:

```
    pdfs_to_filter_in = ["file_A", "file_B"]
    filter_dict = {
        "source": [f"source_pdfs/{pdf_name}.pdf" for pdf_name in pdfs_to_filter_in]
    }
    retriever = db.as_retriever()
    retriever.search_kwargs = {"filter": filter_dict}
```

I added an integration test based on the other ones I found in
`tests/integration_tests/vectorstores/test_faiss.py` under
`test_faiss_with_metadatas_and_list_filter()`.

It doesn't feel like this is worthy of its own notebook or doc, but I'm
open to suggestions if needed.

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
2023-06-21 10:49:01 -07:00
..
cassettes
docarray
docker-compose
fixtures
__init__.py
conftest.py
fake_embeddings.py Vector store support for Cassandra (#6426) 2023-06-20 10:46:20 -07:00
test_alibabacloud_opensearch.py Add Alibaba Cloud OpenSearch as a new vector store (#6154) 2023-06-20 10:07:40 -07:00
test_analyticdb.py Improve AnalyticDB Vector Store implementation without affecting user (#6086) 2023-06-17 09:36:31 -07:00
test_annoy.py
test_atlas.py
test_awadb.py Add a new vector store - AwaDB (#5971) (#5992) 2023-06-10 15:42:32 -07:00
test_azuresearch.py Harrison/cognitive search (#6011) 2023-06-11 21:15:42 -07:00
test_cassandra.py Vector store support for Cassandra (#6426) 2023-06-20 10:46:20 -07:00
test_chroma.py fix chroma update_document to embed entire documents, fixes a characer-wise embedding bug (#5584) 2023-06-02 11:12:48 -07:00
test_clickhouse.py Integrate Clickhouse as Vector Store (#5650) 2023-06-05 13:32:04 -07:00
test_deeplake.py Harrison/deeplake new features (#6263) 2023-06-16 17:53:55 -07:00
test_elasticsearch.py Add the usage of SSL certificates for Elasticsearch and user password authentication (#5058) 2023-05-22 11:51:32 -07:00
test_faiss.py feat: faiss filter from list (#6537) 2023-06-21 10:49:01 -07:00
test_hologres.py Harrison/hologres (#6012) 2023-06-11 20:56:51 -07:00
test_lancedb.py
test_milvus.py
test_mongodb_atlas.py Harrison/myscale self query (#6376) 2023-06-18 16:53:10 -07:00
test_myscale.py
test_opensearch.py
test_pgvector.py Add texts with embeddings to PGVector wrapper (#5500) 2023-05-31 17:31:52 -07:00
test_pinecone.py
test_qdrant.py qdrant: search by vector (#6043) 2023-06-17 09:44:28 -07:00
test_redis.py Update redis integration tests (#4937) 2023-05-18 10:22:17 -07:00
test_rocksetdb.py Integrate Rockset as Vectorstore (#6216) 2023-06-21 01:22:27 -07:00
test_singlestoredb.py Update SinglStoreDB vectorstore (#6423) 2023-06-19 22:08:58 -07:00
test_tair.py
test_vectara.py Update to Vectara integration (#5950) 2023-06-10 16:27:01 -07:00
test_weaviate.py Fixes issue #5072 - adds additional support to Weaviate (#5085) 2023-05-22 18:57:10 -07:00
test_zilliz.py