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
[FEATURE] ElasticSearch 8 took away support for "Nullable" fields for Term Query #8008
Comments
Work around doesn't work because it sends the field as null.... would be nice if framework ignored nulls
|
@DR9885 I'm not sure if the proposed behavior is desirable in all cases (maybe somebody explicitly wants to query documents with Regarding the workaround: You have to make sure to omit the call to public TermQueryDescriptor<TDocument> FieldValue<T>(this TermQueryDescriptor<TDocument> query, Field field, T? value)
{
if (value is null)
{
return query;
}
return query.Field(field).Value(value);
} |
ES7/NEST client behaves that way though. where if Null is passed it doesn't query that field. But I can see how you'd also want to find nulls... But "Exists" already supports that. Example : of null value, to not query (same as NEST/ES7)
Example : of getting only nulls with exists
|
Another example of why null support would be nice... this is overly verbose, and needs to be done for every min/max
|
@DR9885 Agree with all your posts. |
@flobernd It's the previous behavior see: #4050. |
@nuzolx Steve is no longer maintaining this project. I am the new maintainer and so far this is not on my roadmap. I can see how this feature is nice to have, but judging from the comments in the linked issue, my colleagues as well seem to prefer removing these conditionless queries. I will discuss this with Steve and Martijn in the next weeks and let you know my decision. |
An even better example of code before and after, its way more verbose without this check. Also to up grade to 8.x client, I would need to change a LOT of code in my company. I'm sure I'm not the only one. Before:
After:
|
I can definitely see how this improves readability and reduces code complexity. However I can as well see how this might be very unexpected and confusing behavior for new users. In general I prefer explicit behavior over implicit behavior when it comes to code libraries. If this will be re-implemented, it will be an opt-in feature. It would as well require significant changes to the code generation for which I simply don't have the capacity to work on in the next months. |
Is your feature request related to a problem? Please describe.
ElasticSearch 8 took away support for "Nullable" fields for Term Query
Describe the solution you'd like
Allow passing nullable values, if the value is null. Then the query is not generated.
Example: should not filter on "IsClosed"
Describe alternatives you've considered
Adding an extension method to support this. But should be fixed in framework.
The text was updated successfully, but these errors were encountered: