-
Notifications
You must be signed in to change notification settings - Fork 23
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
Raw Query construction for Request class #22
Comments
If you want a real API for this, can you propose a public API? All your last gist does is move code into a private sub, which doesn't seem reasonable for something you want as a public API. |
I think, maybe $REQUEST->raw_scroll_search(\%CONFIG) Where %CONFIG is just content to pass to the ie: Essentially, all I'm/we're looking for is a way to get an Elasticsearch scrolled query that we can manually bolt on to a The reason I chose a hash reference instead of a list is
Of course, this feature could possibly be complimented with a similar function at the And in that vein, in conjunction with bug #20, we could later add perhaps: $mcpanclient->raw_scrolled_search({
%args
}); Which returns a ResultSet that dispatches instances And $mcpanclient->raw_scrolled_search({
class => "My::Class::Name"
%args
}); Which returns a ResultSet that dispatches instances of But as I said, I'm aware some of these ideas are inconsistent with each other, and I'm not completely sure of half of my opinions yet. Just the short of it is:
|
Being able to bypass the MetaCPAN::Client DSL would be a handy function to have. I like the DWIM aspect for sure, but if we can make it possible to issue arbitrarily complex queries as well which still return the resultset objects, that would solve a lot of problems, in much the same way that DBIx::Class allows raw SQL in queries. I think a discussion of |
this is supported in modern versions |
This really aught to be a discussion of some kind, because I don't really know what I'm doing here.
request->ssearch()
is presently poorly designed for doing raw queries.You can hack around it with
And it works because you can stuff
{body => }
there and blow away the annyoingly constrictive generated one.But its ugly, and the function is not very obvious. You need the
bogus
stuff because without it, it simply breaks due to the generated query having$args != 1
I've considered various ways of hacking around it, to make the interface slightly more usable, for instance:
But that solution strikes me as pretty dodgy because of the magical behaviour that is dependent on the value of
$args
I even considered
But really, that's the same problem all over again, magical behaviour with a magic token.
I think this, slightly more complex approach would be better:
https://gist.github.com/kentfredric/65295334188a7fba4024
Simply because it keeps the existing API exactly the same, doesn't introduce any magical token behaviour, and gives a useful raw search at the same time.
Incidentally, that approach was the first one I tried, and the other ones are later ideas I had after I realised you could already pass custom params.
The text was updated successfully, but these errors were encountered: