[ckan-dev] Group search via API (v2)

Kussatz, Tilo Tilo.Kussatz at fokus.fraunhofer.de
Wed May 18 09:32:46 UTC 2011


Hi David,

thanks for your reply - I'll move it over  to the dev list now.

I followed your steps using a new DB and the test data and get the
correct results for those groups, too.

But when I create a new groups and add some of the packages to them (via
the web interface), I get empty result sets again through the API.

The permissions look fine, they are the same as for the existing groups:

User visitor ->  is reader on ->  Group tilo

reader              read-site, read-user, create-user, read


The web interface also displays the group's packages when I'm logged
out, but the API returns

$ curl http://localhost:5000/api/search/package?groups=tilo
{"count": 0, "results": []}


It seems there's something missing still, although the groups look quite
the same?

Best regards,

Tilo

Am 12.05.2011 15:26, schrieb David Read:
>  On 12 May 2011 14:15, David Read<david.read at okfn.org>   wrote:
>>  Hi Tilo,
>>
>>  ckan.net uses SOLR for its backend. See the docs for configuring that.
>>
>>  But this should all work using the default backend (postgres full text search).
>>
>>  Starting from scratch I find this works for me. I'm using revision 5894ac005a a0
>>
>>  $ paster db init
>>  $ paster create-test-data
>>  $ paster serve --reload development.ini&
>>  $ curl http://localhost:5000/api/search/package?groups=david
>>  {"count": 2, "results": ["warandpeace", "annakarenina"]}
>>  $ curl http://localhost:5000/api/search/package?groups=roger
>>  {"count": 1, "results": ["annakarenina"]}
>  And I've checked this also works for 1.4.1a (0bc1ed5ea0c3) and API version 2.
>
>  Permissions may be the problem for you. Do:
>  $ paster rights
>  and check you visitor's role on the group you're searching for. Then
>  check that role has the 'read' permission:
>  $ paster roles
>
>  Do ask some more if this doesn't shed any light on the issue, although
>  probably better on the ckan-dev list. All the best,
>
>  David
>
>>  On 12 May 2011 13:29, Kussatz, Tilo<Tilo.Kussatz at fokus.fraunhofer.de>   wrote:
>>>  Hi all,
>>>
>>>  Using the API v2 and CKAN v1.4.1a I am trying to retrieve a list of the
>>>  packages assigned to a specific group. This works as expected if I query
>>>  the ckan.net instance, e.g.:
>>>
>>>  http://ckan.net/api/2/search/package?groups=art
>>>
>>>  returns 16 results, but my local installation returns '{"count": 0,
>>>  "results": []}' for any query with a groups parameter.
>>>
>>>  Through '/api/2/rest/group/art' I get the description, title and other
>>>  information on my instance and can also see that two packages belong to
>>>  this group. It is just the search query that doesn't return them. (I
>>>  have a local group with both name and title of "art" which I assigned
>>>  two packages to via the web interface.)
>>>
>>>  Is there some setting to enable the more advanced search features that
>>>  I overlooked, or could this be an authorization issue? The CKAN
>>>  installation is 'fresh' otherwise.
>>>
>>>  I'd appreciate any pointers,
>>>
>>>  Thanks,
>>>
>>>  Tilo
>>>
>>>
>>>
>>>
>>>  _______________________________________________
>>>  ckan-discuss mailing list
>>>  ckan-discuss at lists.okfn.org
>>>  http://lists.okfn.org/mailman/listinfo/ckan-discuss
>>>





More information about the ckan-dev mailing list