[Archivesspace_Users_Group] Help using AS Restful API to query

James Bullen james at hudmol.com
Fri Nov 8 11:15:14 EST 2019


There is only one index for staff and pui.

From memory the ids of the pui docs have #pui appended.



> On Nov 8, 2019, at 11:13 AM, Seth Shaw <seth.shaw at unlv.edu> wrote:
> 
> That might be it. We don't use the PUI for patron access; but we do still have it left on as the staff occasionally look at it. Certainly something to investigate.
> 
> Regardless, either the API should use one index consistently, have a documented filter (I don't see one there) and/or give some other obvious indication as to where a result came from.
> 
> On Fri, Nov 8, 2019 at 8:02 AM James Bullen <james at hudmol.com <mailto:james at hudmol.com>> wrote:
> 
> Hi Seth,
> 
> I’m not seeing that. Could it be you’re seeing pui docs as well - the instance I’m testing on has the pui turned off.
> 
> 
> Cheers,
> James
> 
> 
>> On Nov 8, 2019, at 10:51 AM, Seth Shaw <seth.shaw at unlv.edu <mailto:seth.shaw at unlv.edu>> wrote:
>> 
>> James, I was hoping using the filter as you described would remove the duplicate results issue I was having by using the advanced query compound search; but I'm seeing the same thing as before. 
>> 
>> Running the search via the API: 'archivestest:8089/search?type[]=archival_object&page=1&filter={"query":{"comparator":"greater_than","field":"system_mtime","value":"2019-10-02","jsonmodel_type":"date_field_query"}}' returns, in part, `{"page_size":10,"first_page":1,"last_page":874,"this_page":1,"offset_first":1,"offset_last":10,"total_hits":8732,` ...
>> 
>> Whereas the SQL query `SELECT count(*) FROM archival_object WHERE system_mtime > '2019-10-02';` is returning "4369" (half the results of the REST query).
>> 
>> Have you run into this issue before?
>> 
>> 
>> 
>> On Fri, Nov 8, 2019 at 7:34 AM James Bullen <james at hudmol.com <mailto:james at hudmol.com>> wrote:
>> 
>> Something like this works for me:
>> 
>> /search type[]=resource type[]=archival_object page=1 filter={"query":{"comparator":"greater_than","field":"system_mtime","value":"2019-10-02","jsonmodel_type":"date_field_query"}}
>> 
>> 
>> 
>> 
>>> On Nov 8, 2019, at 10:24 AM, Seth Shaw <seth.shaw at unlv.edu <mailto:seth.shaw at unlv.edu>> wrote:
>>> 
>>> To do this you need to use the advanced query parameter which, unfortunately, is not well documented. There are a few email threads that describe using the advanced search though:
>>> 
>>> http://lyralists.lyrasis.org/mailman/htdig/archivesspace_users_group/2015-June/001734.html <http://lyralists.lyrasis.org/mailman/htdig/archivesspace_users_group/2015-June/001734.html>
>>> 
>>> I've formulated queries like you describe before (I'll have to dig through my notes to see if I can find it again); but the result set was consistently giving me back duplicate results for some unknown reason; so I stopped using it. 
>>> 
>>> Ideally, we would be able to add a 'modified_since' parameter to each entity's endpoint to get the most recent set. The capability exists in the code, but hasn't been exposed to the REST end-point. I've submitted a ticket that will hopefully lead to this being resolved: https://archivesspace.atlassian.net/browse/ANW-962?filter=-2 <https://archivesspace.atlassian.net/browse/ANW-962?filter=-2>.
>>> 
>>> 
>>> On Fri, Nov 8, 2019 at 7:07 AM Steve Mattison <smattiso at nd.edu <mailto:smattiso at nd.edu>> wrote:
>>>  <https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=archivesspace_users_group@lyralists.lyrasis.org>Community,
>>> 
>>> I'm new to using ArchivesSpace, and new to using the AS API.  I need to use the API to search within a given repository to find records that have been modified after a particular time (e.g. modified within the last 48 hours).  (We then want to export metadata related to those resources or archival_objects for a project we're working on.)
>>> 
>>> I have found the documentation for search-this-repository <http://archivesspace.github.io/archivesspace/api/?shell#search-this-repository>, but don't know how to formulate a query to find all resources and/or archival_objects where the system_mtime is after a particular time.  I would be fine with performing two searches, one for resources and one for archival_objects, if that is required.
>>> 
>>> Any help with the syntax for the query would be much appreciated.
>>> 
>>> Thanks for your help.
>>> 
>>> -- 
>>> Steve Mattison
>>> Lead Software Engineer, Digital Library Technologies
>>> Hesburgh Libraries
>>> 
>>> University of Notre Dame
>>> 271 Hesburgh Library
>>> Notre Dame, IN 46556-5629
>>> o: 574-631-8559
>>> e: steve.mattison at nd.edu <mailto:steve.mattison at nd.edu>
>>> 
>>> _______________________________________________
>>> Archivesspace_Users_Group mailing list
>>> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
>>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
>>> _______________________________________________
>>> Archivesspace_Users_Group mailing list
>>> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
>>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
>>> 
>>> 
>>> 
>> 
>> _______________________________________________
>> Archivesspace_Users_Group mailing list
>> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
>> !DSPAM:5dc58f16257571993821028! _______________________________________________
>> Archivesspace_Users_Group mailing list
>> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
>> 
>> 
>> !DSPAM:5dc58f16257571993821028!
> 
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group <http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group>
> !DSPAM:5dc59426273611268720720! _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
> 
> 
> !DSPAM:5dc59426273611268720720!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20191108/faeb0eee/attachment.html>


More information about the Archivesspace_Users_Group mailing list