Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Projects
None yet
4 participants
Contributor

SineSwiper commented May 4, 2014

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.

Contributor

mickeyn commented May 12, 2014

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

Contributor

xsawyerx commented May 13, 2014

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.

Owner

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.

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