Right now, if you want to set loading options when building a search query, it has to be the very first thing you do:
As you can see, it's quite weird when specifying the result type explicitly.
Ideally we'd want this:
... but because we want to support backend-specific options in .asProjection(), it's not possible (at least not unless we define one API for every mapper/backend combination).
Maybe we could expose something like this?
Note this could make much more sense when combined with HSEARCH-3628, where we need to expose per-type options. We'd end up with this:
Or, more probably (to be truly mapper-agnostic, and avoid the dubious assumption that mapped types are Java types):
We may want to also allow an optional, non-lambda syntax: