-
Notifications
You must be signed in to change notification settings - Fork 1.2k
8.15.6 - Bring Back IProperty.Name #8336
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
Comments
Hi @niemyjski, this is a difficult one. In ES, property objects do not hold their names. They are always used as part of a dictionary ( {
"prop": {
"my_property": {
"type": "boolean",
"...": "..."
}
}
} Keeping the property name as local metadata in the Would it help, if I add an additional method to the class Properties
{
public string? TryGetName(IProperty property) { ... }
} |
That would be extremely useful! |
I just double checked and saw that Given that fact, I think that a custom |
I think it helps those that are upgrading I'm also using this on IProperty not IProperties, am I missing something? |
The Elasticsearch API uses NEST changed the structure by pulling-in the dictionary key as a synthetic This is problematic for at least 3 reasons:
I think the trick is to pass var propertyName = properties.FirstOrDefault(x => ReferenceEquals(x.Value, property)).Key; Would that work for you? |
Elastic.Clients.Elasticsearch version: 8.15.6
Elasticsearch version: 8.15.1
.NET runtime version: 8.x
Operating system version: Any
Description of the problem including expected versus actual behavior:
Seems really important for debugging and lookup purposes to have the field name attached to a property. Maybe this could be stored in local metadata?. We use this heavily in Foundatio.Parsers for:
Expected behavior
Being able to lookup properties by name
Reference: FoundatioFx/Foundatio.Parsers#84
The text was updated successfully, but these errors were encountered: