-
Notifications
You must be signed in to change notification settings - Fork 802
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
How to assign custom field names to Document fields #1659
Comments
@honzakral can you help me? |
I am sorry, but there is no better way of doing it. By prefixing fields with Introducing possible aliases would be a way but currently there is no one maintaining the library. See #1652 |
Also mentioned in #1345 |
We are trying to use the Documents API to connect with our existing Elasticsearch server however, we have a convention of prefixing our field names with '@' ("field1" = "value" is persisted as "@field1" = "value"). What we are looking for is a way to define custom names to properties as such:
The current way we are approaching this problem is by overriding the parent to_dict() method with the same to_dict method with just the key name adjusted.
However, this solution isn't the most favorable way of doing this while working on the init() and save() methods it may result in problems with the other methods of the class in the future. Is there a better way of doing this or a future plan to support custom field names?
The text was updated successfully, but these errors were encountered: