-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
feat: Add support for dynamic metadata fields in Elasticsearch index creation #14431
Conversation
...ores/llama-index-vector-stores-elasticsearch/llama_index/vector_stores/elasticsearch/base.py
Outdated
Show resolved
Hide resolved
@logan-markewich Actually, I didn't think that much about it. At the time, I just thought that the metadata_mappings could be extracted from **kwargs. However, I think setting it as a named parameter is a good idea; it looks more standardized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this example, metadata_mappings doesn't seem to be a commonly used or particularly important parameter. I think it is an optional and less frequently used parameter. Personally, I believe using **kwargs might be more appropriate.
Thanks @minglu7. I think I have I agree with Logan here. I believe parameters such as |
feat: Add support for dynamic metadata fields in Elasticsearch index creation
This commit enhances the flexibility of our Elasticsearch index creation by allowing dynamic metadata fields to be passed as keyword arguments during the initialization.
Key changes:
__init__
method to acceptmetadata_mappings
as part of**kwargs
, enabling the customization of metadata fields._create_index_if_not_exists
method to incorporate the merged metadata fields.Benefits:
metadata_mappings
directly inkwargs
keeps the method signatures clean and intuitive.This change ensures that our Elasticsearch indices can be tailored to specific application requirements while maintaining a straightforward and flexible API.