[Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Steve Mattison
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

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Andrew Morrison
Hi Steve, The Solr syntax to find records modified in the last 48 hours is: system_mtime:[NOW-48HOUR TO NOW] But I haven't tried running that sort of search query via the ArchivesSpace API. Andrew. On Fri, 2019-11-08 at 10:06 -0500, Steve Mattison wrote:

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Seth Shaw
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 I've formulated queries li

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Seth Shaw
Found where I have examples documented: https://github.com/jasloe/archivesspace-drupal/issues/23. I also describe my issues with duplicate results on this comment: https://github.com/jasloe/archivesspace-drupal/issues/23#issuecomment-454869214 . On Fri, Nov 8, 2019 at 7:24 AM Seth Shaw wrote: >

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread James Bullen
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 wrote: > > To do this you need to

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Seth Shaw
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"

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread James Bullen
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 wrote: > > James, I was hoping using the filter as you described would remove the > duplicate results issue

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Seth Shaw
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 othe

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread James Bullen
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 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

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Custer, Mark
Seth, Here’s another example: search?type[]=archival_object&page=1&aq= { "query": { "op": "AND", "subqueries": [ { "field": "keyword", "value": "39002102378974", "jsonmodel_type": "field_query", "negat

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Seth Shaw
Thanks, James and Mark. I appreciate the additional pointers. (And sorry for high-jacking your thread, Steve!) On Fri, Nov 8, 2019 at 8:20 AM Custer, Mark wrote: > Seth, > > > > Here’s another example: > > > > search?type[]=archival_object&page=1&aq= > > { > "query": { > "op": "AND",

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Steve Mattison
This has all been most helpful. I've now successfully queried based upon system_mdate, next, I'll eliminate the pui entries, and I think I'll be all set. Thank you everyone for all your help. On Fri, Nov 8, 2019 at 11:26 AM Seth Shaw wrote: > Thanks, James and Mark. I appreciate the additiona

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Custer, Mark
And Steve, now that I’m looking at your question, I *think* that everything already mentioned should point you in the right direction for doing that search with the API. It sounds like your use case might be aimed at performing very granular updates, but in case it’s helpful, here’s the approac

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Steve Mattison
This is very helpful. Thank you so much for passing this along. On Fri, Nov 8, 2019 at 11:53 AM Custer, Mark wrote: > And Steve, now that I’m looking at your question, I **think** that > everything already mentioned should point you in the right direction for > doing that search with the API. >

Re: [Archivesspace_Users_Group] Help using AS Restful API to query

2019-11-08 Thread Kevin W. Schlottmann
Hi Steve, I'm a little late to this thread, but I wanted to note that depending on your exact use case, the built-in OAI-PMH endpoint might be useful. You can specify the exact time range of modified times desired; choose MARC, EAD, or DC (all in XML though); set whether the entire record is down