Qdrant: `in` filter with an empty list matches all documents (delete_by_filter deletes everything)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading the Qdrant filter converter and the existing Elasticsearch handling for an empty should; compare their behavior with InMemoryDocumentStore. Add coverage for in [] and its negation, then check filtering, counting, and deletion so an empty list matches no documents and its negation matches all. The issue says the reporter already has a fix with tests ready, so check whether that work has moved to a pull request before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
In QdrantDocumentStore, a filter with "operator": "in" and an empty list matches every document instead of none. The converter builds Filter(should=[]), and Qdrant treats an empty should as no condition.
This is easy to hit when the list is built at runtime (for example allowed file ids or user ids that turn out empty). It is worst with delete_by_filter(), which then deletes the whole collection. count_documents_by_filter() and retrievers are affected the same way, and NOT around such a filter returns nothing.
InMemoryDocumentStore returns no documents for in [], and the Elasticsearch filters already handle this case explicitly ("An empty should would match every document").
To Reproduce
from haystack import Document
from haystack_integrations.document_stores.qdrant import QdrantDocumentStore
store = QdrantDocumentStore(location=":memory:", embedding_dim=4, recreate_index=True)
store.write_documents([Document(content=f"doc {i}", meta={"file_id": f"f{i}"}) for i in range(3)])
f = {"field": "meta.file_id", "operator": "in", "value": []}
print(len(store.filter_documents(f))) # 3, expected 0
print(store.count_documents_by_filter(f)) # 3, expected 0
print(store.delete_by_filter(f)) # 3, expected 0
print(store.count_documents()) # 0, expected 3
Expected behavior
in [] matches no documents (and NOT of it matches all), like InMemoryDocumentStore.
Additional context
Seen on main (02bb4f7) with qdrant-client 1.20.0, both with location=":memory:" and a local Qdrant 1.20.0 server. A small fix is to return FieldCondition(key=..., match=MatchAny(any=[])) for an empty list, which matches nothing in both modes. I have a fix with tests ready and will open a PR.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 396
- Merge medio
- 2g 9h
- PR unite (30g)
- 95
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di deepset-ai/haystack-core-integrations
-
integration:qdrant P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
deepset-ai/haystack-core-integrations#4228 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
FAISS: filtered search misses matching documents outside the first top_k * 10 neighboursForse già presa @davidsbatista l’ha presa 2 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4322 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add Late Interaction Qdrant RetrieverForse già presa @anakin87 l’ha presa 6 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4307 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Ollama - `OllamaChatGenerator` returns `finish_reason=None` when output is truncated (`done_reason="length"`)Forse già presa @davidsbatista l’ha presa 6 giorni fa. Aperta
deepset-ai/haystack-core-integrations#4302 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Retrievers treat `run(top_k=0)` as unset because of `top_k or self.top_k`Forse già presa @bogdankostic l’ha presa 8 giorni fa. ApertaP3
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
deepset-ai/haystack-core-integrations#4273 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di deepset-ai/haystack-core-integrations
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
micronaut-projects/micronaut-core#14585 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
langgenius/graphon#443 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG]: Management endpoints /v1/memory/stats and /v1/memory/counts bypass API key authenticationAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
docling-project/docling-serve#788 ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
opensearch-project/cross-cluster-replication#1805 ·
I maintainer di solito rispondono entro 1 giorno