CPAN-API/cpan-api — Issue #155: v0/release doesn't return limited results while v0/release/_search does
Author: kentfredric
Created: 2012-01-06 11:21:26+00:00
State: open

Given the following command:

curl -d '{"sort":[{"date":"desc"}],"query":{"constant_score":{"filter":{"term":{"distribution":"App-perlbrew"}}}},"size":1}' http://api.metacpan.org/v0/release

The first result returned is seemingly random ( in fact, whatever is most recent on cpan ). The Term limiting part of the filter seems completely inoperative. I haven't tested much of the other factors to see how they influence things, but size:1 appears to work.

Changing the uri to have `/_search` at the end

curl -d '{"sort":[{"date":"desc"}],"query":{"constant_score":{"filter":{"term":{"distribution":"App-perlbrew"}}}},"size":1}' http://api.metacpan.org/v0/release/_search

Returns expected results.

Previously, expected results were returned simply from the `/release` uri , and was the expected semantics via `MetaCPAN::API`

->post( 'release', { .. search .. } )

However, what is presently required to get the correct results is:

->post( 'release/_search' , { .. search .. } )