Skip to content

feat(vectorsearch): add metadata support to Elasticsearch adapter #964

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

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

Conversation

sergiobayona
Copy link
Collaborator

Adds the ability to store and search by metadata in the Elasticsearch vector search provider:

  • Extended add_texts and update_texts to accept optional metadatas parameter
  • Updated index mapping to include a dynamic metadata object field
  • Added filter parameter to similarity search methods for metadata-based filtering
  • All changes maintain backward compatibility with existing code
  • Added comprehensive test coverage for the new functionality
  • Created an example script to demonstrate metadata usage with Elasticsearch

This enhancement brings the Elasticsearch adapter to parity with other vector stores like Pinecone, Chroma, PGVector and Qdrant that already supported metadata. Users can now store arbitrary metadata alongside their text and embedding vectors, then filter search results based on metadata fields.

Adds the ability to store and search by metadata in the Elasticsearch vector search provider:

- Extended `add_texts` and `update_texts` to accept optional `metadatas` parameter
- Updated index mapping to include a dynamic `metadata` object field
- Added `filter` parameter to similarity search methods for metadata-based filtering
- All changes maintain backward compatibility with existing code
- Added comprehensive test coverage for the new functionality
- Created an example script to demonstrate metadata usage with Elasticsearch

This enhancement brings the Elasticsearch adapter to parity with other vector
stores like Pinecone, Chroma, PGVector and Qdrant that already supported metadata.
Users can now store arbitrary metadata alongside their text and embedding vectors,
then filter search results based on metadata fields.
@sergiobayona sergiobayona force-pushed the 963-ability-to-include-metadata-for-elasticsearch branch from 9ed326b to ee0b39e Compare April 21, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant