-
Notifications
You must be signed in to change notification settings - Fork 49
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
[BUG] TermSet query generates an empty query instead #371
Comments
I have now found that using
|
Using the following code: var response = client.Search<Doc>(s => s
.Index("my-index")
.Query(q => q
.Bool(bq => bq
.Must(mq => mq
.TermsSet(f =>
f.Field(d => d.Foo).Terms(new int[] { 3, 7, 80 })
.MinimumShouldMatchScript(sr => sr.Source("1"))
)
)
)));
Console.WriteLine(Encoding.UTF8.GetString(response.ApiCall.RequestBodyInBytes)); I'm able to confirm it's generating the expected search query: {"query":{"bool":{"must":[{"terms_set":{"foo":{"minimum_should_match_script":{"source":"1"},"terms":[3,7,80]}}}]}}} I can confirm though that if you had initially excluded |
Hm... Weird. You can close this issue if you like. |
You're correct regarding |
What is the bug?
I cannot build a TermSet query that uses a script.
When I try to do so, an empty query gets sent.
How can one reproduce the bug?
Just use this code that tries to select documents with a field matching any value in a set of values:
I have also tried this without success:
What is the expected behavior?
A TermSet query gets sent to the OpenSearch node.
What is your host/environment?
Windows 11 Pro
Do you have any screenshots?
Do you have any additional context?
There is this related StackOverflow question: https://stackoverflow.com/q/77143853/2173353
This is what I get in the log file (
opensearch_index_search_slowlog.log
) :I use the latest Nuget package (v.1.5.0).
The text was updated successfully, but these errors were encountered: