[Archivesspace_Users_Group] API queries for library discovery interface question
Majewski, Steven Dennis (sdm7g)
sdm7g at virginia.edu
Wed Feb 14 12:14:13 EST 2018
It looks like your example got a little mangled along the way: I assume what’s between the “<…>” doesn’t belong.
But the ‘-H’ switch sends “q:java” as a HTTP header, not as a search param, so with a null query string, you are asking for everything.
Try maybe: "http://as.lib.msu.edu:8089/search?page=1&page_size=5&q=java <http://as.lib.msu.edu:8089/search?page=1&page_size=5&q=java>”
or if you want to send it as a POST instead of a GET request, use -F or —form switch.
Also, when debugging search problems, it’s sometimes handy to go directly to the Solr console at port 8090, if you’re using the default Solr settings in ArchivesSpace.
— Steve.
> On Feb 14, 2018, at 11:45 AM, Tang, Lydia <ltang5 at lib.msu.edu> wrote:
>
> Good morning, all!
> I have a mystery… My institution is trying to pull from the API to integrate the results in our search discovery interface of our catalog. The mystery is that apparently, our API call seems to bring back bogus results whereas if we scrape from the HTML of the PUI, the search results are as expected.
> Here is the API call
>
> curl -H "X-ArchivesSpace-Session: c3a1ea6a48af5e9324a19bf1e79d284b921cbc97aed93b143d76b6b457f5b144 " -H "q:java" "http://as.lib.msu.edu:8089//search?page=1&page_size=5<http://as.lib.msu.edu:8089/search?page=1&page_size=5> <http://as.lib.msu.edu:8089//search?page=1&page_size=5%3Chttp://as.lib.msu.edu:8089/search?page=1&page_size=5%3E>"
>
> If you look closely I’m searching for java and I want the 1st page with 5 results
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20180214/7e7b6d39/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4943 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20180214/7e7b6d39/attachment.bin>
More information about the Archivesspace_Users_Group
mailing list