Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug filtering with not equal operator in astra #867

Closed
basoko opened this issue Jul 4, 2024 · 0 comments · Fixed by #868
Closed

Bug filtering with not equal operator in astra #867

basoko opened this issue Jul 4, 2024 · 0 comments · Fixed by #868
Labels
bug Something isn't working

Comments

@basoko
Copy link
Contributor

basoko commented Jul 4, 2024

Describe the bug

When applying an haystack not equal filter != this is mapped to an invalid astra filter operator $neq. Based on the astra documentation https://docs.datastax.com/en/astra-db-serverless/api-reference/overview.html the correct operator should be $ne.

This produces the following error:

astrapy.core.api.APIRequestError: {"errors":[{"message":"Unsupported filter operator: $neq","errorCode":"UNSUPPORTED_FILTER_OPERATION"}]}

To Reproduce

import os
from haystack_integrations.document_stores.astra import AstraDocumentStore

collection_name = os.getenv("COLLECTION_NAME", "haystack_vector_search")
document_store = AstraDocumentStore(
    collection_name=collection_name,
)
document_store.filter_documents({
    "field": "meta",
    "operator": "!=",
    "value": {
        "file_path": "/workspace/astra-haystack/examples/data/usr_01.txt",
        "source_id": "5b2d27de79bba97da6fc446180d0d99e1024bc7dd6a757037f0934162cfb0916",
    },
})

Steps to reproduce the behavior. Feel free to link a Colab we can run to investigate the issue.

Describe your environment (please complete the following information):

  • OS: [e.g. iOS]
  • Haystack version: 2.x
  • Integration version: 0.8.0
@basoko basoko added the bug Something isn't working label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant