Skip to content
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

[PROPOSAL] #846

Open
cmprojectcm opened this issue Oct 30, 2024 · 0 comments
Open

[PROPOSAL] #846

cmprojectcm opened this issue Oct 30, 2024 · 0 comments

Comments

@cmprojectcm
Copy link

cmprojectcm commented Oct 30, 2024

What/Why

What are you proposing?

This is not an actual proposal, but a question.

What users have asked for this feature?

am using opensearch client for .net, and I realized that if I use the below query. However the values to be added in Query(item) are coming as parameters in a functions and may be null. I was wondering if in the below syntax query if for example request.field is null, does the condition getting discarded or it looks for null values in the database?

My actual experience was that it ignores the specific AND condition, but I would like to doble check with you guys.

var searchResponse = client.Search<ModelToCheck>(s => s.Index("opensearch index") .From(0) .Size(10) .Query(q => q .Bool(b => b .Filter(f => { return f.DateRange(dr => dr .Field(field => field.TrDate) .GreaterThanOrEquals(request.FromDate) .LessThanOrEquals(request.ToDate)) && f.Match(m => m.Field(fi => fi.field1).Query(request.field1)) && f.Match(m => m.Field(fi => fi.field2).Query(request.field2)) && f.Match(m => m.Field(fi => fi.field3).Query(request.field3)) && f.Match(m => m.Field(fi => fi.field4).Query(request.field4)) && f.Match(m => m.Field(fi => fi.field5).Query(request.field5)) && f.Match(m => m.Field(fi => fi.field6).Query(request.field6)); }))));

What problems are you trying to solve?

Trying to simplify a dynamic opensearch query when we have dynamic values

What is the developer experience going to be?

if the value inside .Query() is null, ignore that operand section.

Are there any security considerations?

We need to clarify on a conf whether to search for null values or to ignore the query if the value parameter is null.

Are there any breaking changes to the API

What is the user experience going to be?

Are there breaking changes to the User Experience?

Why should it be built? Any reason not to?

What will it take to execute?

Any remaining open questions?

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

No branches or pull requests

1 participant