Closed yassenb closed 1 year ago
right, I'll have a look at that one. Thanks for reporting
Wow, this was broken in a lot of places. I changed the naming convention to default to asIs at some point without realizing I had to fix this all over the DSL. Fixed by #28
Thanks but why was the default switched to "asIs"? Look at the many places where you need to override it and potential future extensions will have to be careful to override as well. Why not default to snake case when this is the default for OpenSearch/ElasticSearch?
I agree, this is the better fix. I changed this because I see uses for JsonDsl beyond the search client. But it is a bit error prone to deal with so I'm fixing this properly with a separate pull request.
Describe the bug
Setting
MatchQueryConfig.maxExpansions
doesn't workTo Reproduce
Steps to reproduce the behavior: Configure a
match
query withmaxExpansions = 100
(any number works) and execute the query. An error "[match] query does not support [maxExpansions]" is returned because the client passes"maxExpansions": 100
as part of the JSON sent to the OpenSearch serverExpected behavior
"max_expansions": 100
should be passed to the OpenSearch serverYour context
latest version 1.99.14 on Ubuntu 22.04
Will you be able to help with a pull request?
Sure, I can create a PR
Overall I think the default for the
JsonDsl
constructor should benamingConvention = PropertyNamingConvention.ConvertToSnakeCase
. That's the naming convention for OpenSearch after all. Naming things camelCase should be the exception, not the rule