[Archivesspace_Users_Group] limiting API search query to specific record types

Donald Mennerich don.mennerich at nyu.edu
Wed Nov 9 11:43:28 EST 2016


AUG:

I am trying to get resource records from the ASpace API, I'm currently
using the advanced query example that Chris had posted in 2015.

> response = client.get('repositories/3/search?page=1&
> aq={"query":{"field":"title","value":"Jeremy Blake Papers",
> "jsonmodel_type":"field_query","negated":false,"literal":true}}')

While this returns the wanted resource record, the api also returns an
accession record and a collection control management. So my question: how
can I filter to just resource records? I see in the json for any record has
a field to  "type"=>["resource"], and there's documentation in the API
about using this field in an advanced query:

[String] type – The record type to search (defaults to all types if not
> specified)


I've tried adding a "type" parameter to a query in numerous ways, such as:

> response = client.get('repositories/3/search?page=1&
> aq={"query":{"field":"title","value":"Jeremy Blake Papers",
> "jsonmodel_type":"field_query","negated":false,"literal":true, *"type":
> ["resource"] *}}')


Can anyone provide some guidance on how to limit results from the search
API to specific record types?

Thanks.

Don
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20161109/459cc381/attachment.html>


More information about the Archivesspace_Users_Group mailing list