[ckan-dev] How to access an array in extra-fields ?
David Read
david.read at okfn.org
Mon May 2 20:44:50 UTC 2011
Pascal,
It's great you're using our API and pushing us on it! Allow me to
summarise your issues (correct if necessary) and where we're at with
them.
* http://trac.ckan.org/ticket/1116 Api search loses boolean q options
(filter_by_openness)
* FIXED
* http://trac.ckan.org/ticket/1112 Allow api searching for all packages (q=*)
* FIXED (use q=)
* http://trac.ckan.org/ticket/1121 JSON extras appear in package edit
form mangled
* To be assigned
* http://trac.ckan.org/ticket/1122 JSON Extra data not searchable
* @pudo I notice you tackling solr indexing of lists/tuples in
ckanext-solr cset:ecc2d69df991 so have updated to use this on ckan.net
and reindexed, but #1122 still seems an issue - any chance you can
take a look
Storing lists, tuples & dicts in extra fields is something we want to
support for harvesting, but I wasn't aware this was a feature
wanted/needed be front end users. I guess you could store the list
quoted, so it is stored as a JSON string, rather than something that
acts like a collection and hence confuses the form & search, but would
that make life harder for you Pascal?
BTW I failed to mention you can POST parameters. These examples (now)
all give the same response:
curl 'http://ckan.net/api/1/search/package?q=lobid&filter_by_openness=1'
curl 'http://ckan.net/api/1/search/package' -d 'q=lobid&filter_by_openness=1'
curl 'http://ckan.net/api/1/search/package' -d '{"q": "lobid",
"filter_by_openness": "1"}'
David
On 29 April 2011 09:36, David Raznick <kindly at gmail.com> wrote:
>
>
> On Thu, Apr 28, 2011 at 4:57 PM, William Waites <ww at styx.org> wrote:
>>
>> * [2011-04-28 16:44:09 +0100] David Raznick <kindly at gmail.com> écrit:
>>
>>
>> ] It should be getting a json dumps only if its *not* a plain string. It
>> is
>> ] stored as a json but on return to the wui it gets converted to the
>> repred
>> ] version.
>>
>> If I'm not mistaken the OP is using the API and gets, inter alia,
>>
>> "extras": {"publishingInstitution":
>> "[u'http://lobid.org/organisation/DE-605',
>>
>> Note the u'...' smoking gun...
>>
> The u' ' has been fixed but it is tangential to the OP issue.
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
More information about the ckan-dev
mailing list