Skip to content

Include index name in OpenSearchVectorStore for similarity search #1435

Closed
inpink wants to merge 1 commit intospring-projects:mainfrom
inpink:0929-opensearch
Closed

Include index name in OpenSearchVectorStore for similarity search #1435
inpink wants to merge 1 commit intospring-projects:mainfrom
inpink:0929-opensearch

Conversation

@inpink
Copy link
Copy Markdown
Contributor

@inpink inpink commented Sep 29, 2024

Bug description
When performing a similarity search with SearchRequest, the index name is not included.
This leads to a permission error when using roles restricted to specific indices in Opensearch.

Contents

  • Fixed the issue where the index name was missing in similaritySearch.
    The index was included for adding and deleting documents but not for search.
    I added it to ensure correct behavior.

Test

  • Added tests to verify documents are correctly added and retrieved.
  • Tested this with different indices using separate OpenSearchVectorStore instances.

Issue Link
close #885

@inpink inpink changed the title include index name in OpenSearchVectorStore for similarity search Include index name in OpenSearchVectorStore for similarity search Sep 29, 2024
- Resolved issue where index name was not being sent during similaritySearch.
- Updated similaritySearch method to include index in the SearchRequest.
- Implemented a test to verify that documents can be added and retrieved from two different indices using separate OpenSearchVectorStore instances. Ensured that similarity search results are correctly returned for the respective indices.
@markpollack
Copy link
Copy Markdown
Member

Thanks, much appreciated!! Merged in 5431bdd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opensearch similarity search should include index name

2 participants