Search API - are the facet parameters working as documented?

8 views
Skip to first unread message

Gordon Paynter

unread,
Feb 21, 2011, 6:04:35 AM2/21/11
to DigitalNZ
Hi all:

Can anyone confirm that the DigitalNZ facet params are working as
documented in the search API at:
http://www.digitalnz.org/developer/api-docs/search-records/

If I put in a query like:
http://api.digitalnz.org/records/v1.xml?api_key=[KEY]&search_text=*:*&num_results=5&start=0
then I get a response that includes a lot of facet data.

In other words, it looks like there's an implied
"&facets=all&facet_num_results=100" on the query.

(I'm not even sure if "facets=all" is valid by the way, the point is I
am seeing all the facet data when I am requesting none.)


NB: I noticed some thing similar a few weeks back working on
http://www.paynter.info/dnz/image-distribution.pl
because in that case I was requesting a single facet and getting them
all, which broke things for me.

Anyway, can anyone confirm odd facet behaviour in the search API?

Thanks,
Gordon

jemmyw

unread,
Feb 22, 2011, 12:34:13 AM2/22/11
to DigitalNZ
> Anyway, can anyone confirm odd facet behaviour in the search API?

Hi, I did a quick test and can confirm that you always get back all
the facets. However, if you pass v2 as the version it respects the
facets parameter:
tons of facets

http://api.digitalnz.org/records/v2.xml?api_key=[KEY]&search_text=*:*&num_results=5&start=0

no facets


Jeremy

Gordon Paynter

unread,
Feb 22, 2011, 2:17:20 AM2/22/11
to digi...@googlegroups.com
Thanks, that helps.

Can anyone point me to where the API version is documented.

Is v2 official now? Will v1 be bug-fixed?

Thanks,
Gordon

On 22 February 2011 18:59, jemmyw <jem...@gmail.com> wrote:
> I replied already, so you might get two from me, not sure if google
> groups ate it or delayed it. Anyway, I tested it and can confirm that
> you get 10 facets back when you specify none. Or any, it doesn't seem
> to matter. However, if you change the version number to 2 it respects
> the facets parameter and returns none. Compare:

> to

Message has been deleted

jemmyw

unread,
Feb 22, 2011, 6:07:49 AM2/22/11
to DigitalNZ
> Is v2 official now? Will v1 be bug-fixed?

I assume v2 is official, it's mentioned here:
http://www.digitalnz.org/developer/api-docs/custom-search-records/ but
it's not entirely clear what versions are available and what you
should be using.

But I believe that v1 used to respect the facets parameter anyway,
this seems to be a recent regression. I don't think there were any
changes to the main search function between v1 and v2.
Reply all
Reply to author
Forward
0 new messages