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

David Read david.read at okfn.org
Thu May 12 14:26:51 BST 2011


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-discuss mailing list