Skip to content
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

Don't build a query if a 'body' is already specified #6

Closed
wants to merge 1 commit into from

Conversation

SineSwiper
Copy link
Contributor

This enables queries like:

my $resultset = $mcpan->module(undef, {
   body => ElasticSearch::SearchBuilder->query({
      'module.name'       => $module,
      maturity            => 'released',
      'module.authorized' => 'true',
      'date'              => { '>=' => $year, '<=' => 2099 },
   }),
});

Prior to this tweak, using a still legal query for $args like { DUMMY => 1 } would still work, but using undef or '' makes the intent a bit clearer.

@mickeyn
Copy link
Contributor

mickeyn commented May 12, 2014

hi, sorry for the delay.
I will look into it.

@xsawyerx
Copy link
Contributor

We understand the need for it, but this implementation is not the direction we wish to take to solve it.

We would consider this a misuse of an unchecked option, and instead would prefer to find a clean way of allowing you to do the query you're trying to do. We're looking at how to do that right now.

@oalders
Copy link
Member

oalders commented Oct 15, 2014

I wouldn't mind seeing something like undef or {}, as that's along the lines of what DBIx::Class would expect for a search that needs to return all results.

@mickeyn
Copy link
Contributor

mickeyn commented Nov 22, 2014

from 1.008000 you can get all results using the 'all' method.
e.g. $mcpan->all('releases');

@mickeyn mickeyn closed this Nov 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants