-
Notifications
You must be signed in to change notification settings - Fork 1.2k
MultiSearch for fluently built descriptors in NEST 8 #8468
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 @tdoman , this sadly seems to be one of the places where the new generated client lacks a bit of the convenience of NEST. There is no trivial solution for this problem, since I will keep this issue as a reminder to make sure fluent syntax for multi-search is correctly generated in the future. To support interchangability of the two objects, we could implement an implicit conversion operator from An alternative to unblock you, would be to write your own convert method (this is pretty much about mapping all properties of Another alternative would be to always use multi-search in all places, even if it only contains a single search item. |
Right, if fluent syntax was supported for multi-search, I could probably then take your last suggestion as well and always perform a multi-search hidden behind my abstraction. The implementors then always produce a |
9.0 is around the corner (a few weeks). I'll hope to add fluent support in that release. It will contain quite a few improvements related to descriptors anyways. |
All right, that'd be great to see. I like the cleanness of the composition style approach in NEST 8, I just ran into this roadblock. Keep me posted! |
Elastic.Clients.Elasticsearch version:
8.17
Elasticsearch version:
8.12.2
.NET runtime version:
.NET Standard 2.0
Description of the problem including expected versus actual behavior:
We're looking to migrate from NEST 7 to NEST 8. We're currently using NEST 7 in compatibility mode against ES 8.
In NEST 7, we used fluent syntax to build
SearchDescriptor
for single searches and were able to use that same shape to build forMultiSearch
. In NEST 8, there doesn't appear to be support for that for multi-search, only initializer syntax and a different shape to boot. Here's a look at the operative code we currently have with NEST 7 where I built an abstractionToSearchDescriptor
that expectsSearchDescriptor
(nowSearchRequestDescriptor
) to be produced so that I could mix and match any queries I wanted. This works great!Do you plan to support this style of multi-search in the future? All of our search parameter implementations are built on the fluent syntax so this is a big commitment but it's not clear the direction we should go. It looks like if we re-wrote all of those (no small task) to use initializer syntax (ie.
SearchRequest
), we could manufacture the multi-search shape but even that shape change is confusing now. I expect it has something to do w/ the header for each search but, as shown above, this magic was handled for us and we could be consistent in our abstraction. That is, any implementation that produced aSearchDescriptor
didn't know or care whether it was used for a single or multi-search. Very nice!The text was updated successfully, but these errors were encountered: