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

Add support for kvstore, docstore, indexstore in Opensearch #16813

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

freedom07
Copy link
Contributor

Description

I added support for kvstore, docstore, indexstore for Opensearch. It makes to do bm25 search and hybrid search.

Fixes #16748

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 4, 2024
@freedom07 freedom07 changed the title Freedom07/add opensearch storage Add support for kvstore, docstore, indexstore in Opensearch Nov 4, 2024
@freedom07
Copy link
Contributor Author

@logan-markewich I have added integrations for kvstore, docstore, and indexstore. However docstore and indexstore have dependency on kvstore. Is there any process I have to do? The reason I'm thinking this way is because the unit tests are failing.

@logan-markewich
Copy link
Collaborator

@freedom07 That is not why tests are failing. If you read the logs, I see an error

llama-index-integrations/storage/kvstore/llama-index-storage-kvstore-opensearch/llama_index/storage/kvstore/opensearch/base.py:29: in <module>
    ) -> opensearchpy.AsyncOpenSearch:
E   AttributeError: module 'opensearchpy' has no attribute 'AsyncOpenSearch'

@freedom07
Copy link
Contributor Author

@logan-markewich Thank you I understand. But I added opensearch-py package in pyproject.toml. I expected opensearchpy.AsyncOpenSearch to be accessible, but it's not. After installing the poetry toml file within the integration directory and running pytest locally, there were no issues.

Do you have any idea what might be causing this?

@logan-markewich
Copy link
Collaborator

logan-markewich commented Nov 4, 2024

@freedom07 Pushed a fix -- looks like it was missing the async extras opensearch-py = { version="^2.7.1", extras=["async"] }

@freedom07
Copy link
Contributor Author

@logan-markewich oh I see. Thank you so much!

@logan-markewich
Copy link
Collaborator

@freedom07 any chance we can add unit tests for the kvstore? Ideally we can mock the clients

@freedom07
Copy link
Contributor Author

@logan-markewich That sounds like a good idea. However, it's too late today, so I'll give it a try after getting some sleep.

@logan-markewich logan-markewich self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: BM25 with OpenSearch
3 participants