Skip to content

Instantly share code, notes, and snippets.

@ericgriffis
Last active July 15, 2016 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ericgriffis/d84fca709745df507eccb437e230f23a to your computer and use it in GitHub Desktop.
Save ericgriffis/d84fca709745df507eccb437e230f23a to your computer and use it in GitHub Desktop.
Swiftype API search issues
{
"external_id":"776c94748ed5f2cd0769c400deb855411e391225",
"engine_id":"55c5390cd3b687dbc9000012",
"document_type_id":"55c5390cd3b687dbc9000014",
"id":"577e0addc75d070216e6d7da",
"updated_at":"2016-07-15T07:55:49+00:00",
"site_domain":"http://dev.library.nyu.edu",
"url":"http://dev.library.nyu.edu/services/borrowing/nyu/day-shelf/",
"collection":"services",
"card_html":" <div class=\"item item--without-thumb\"> <h2 class=\"item__title\"> <a href=\"/services/borrowing/nyu/day-shelf/\" title=\"View more info on Day Shelf\">Day Shelf</a> </h2> <p class=\"item__meta\"> </p> </div>",
"title":"Day Shelf",
"departments":"Access, Delivery & Resource Sharing Services",
"location":"Elmer Holmes Bobst Library",
"stringified_departments":"Access, Delivery & Resource Sharing Services",
"position":5,
"sections":["Day Shelf","How to use the Day Shelf","Get Help","FAQs","Quick Links"],
"body":"Search the Library Services Borrowing From NYU & Consortium Libraries Day Shelf Elmer Holmes Bobst Library Temporarily leave books you don\u2019t want to check out immediately on the Day Shelf, located at the south end of the [Bobst Library Circulation & Reserves desk]. How to use the Day Shelf Insert a color laminated strip of paper from the box marked \u201cTODAY\u2019S COLOR\u201d into each of the books you are leaving on the shelf. Retrieve your books before Circulation & Reserves closes the following day. When you pick up your books, please return the flags in the box marked \u201cRETURN USED FLAGS HERE\u201d. Get Help FAQs See more Quick Links Circulation Desk Hours Chat with us \u2421",
"type":"",
"image":"",
"published_at":"2016-07-15T07:55:49Z",
"popularity":1,
"info":"",
"updated_at":"2016-07-13T21:19:47Z"
}
curl -X GET "https://api.swiftype.com/api/v1/engines/nyu-libraries/document_types/page/documents/577e0addc75d070216e6d7da.json?auth_token=${SWIFTYPE_API_KEY}"
{
"record_count":0,
"records":{"page":[]},
"info":{
"page":{
"query":"Access, Delivery & Resource Sharing Services",
"current_page":1,
"num_pages":0,
"per_page":5,
"total_result_count":0,
"facets":{}
}
},
"errors":{}
}
curl -X GET 'https://api.swiftype.com/api/v1/public/engines/search.json' \
-H 'Content-Type: application/json' \
-d '{
"engine_key": "'"$SWIFTYPE_ENGINE_KEY"'",
"q":"Access, Delivery & Resource Sharing Services",
"filters": {"page": {"collection":"services"}},
"per_page":5,
"page":1
}'
{
"record_count":1,
"records":{
"page":[{
"position":0,
"body":"Search the Library Services Teaching & Learning Learning Consult with Us Request a Consultation Get help from a librarian in your subject area form Fill in your details below to get help from a subject librarian at your library location, or search subject specialists Required Field* Name* E-mail* Net ID* Status* Select one Freshman/Sophomore Junior/Senior Graduate Student Faculty Administrator/Staff Research/Teaching Assistant Other Your Library Location Select one NYC Abu Dhabi Berlin Brooklyn: NYU Tandon School of Engineering Buenos Aires Florence Ghana London Madrid Paris Prague Shanghai Other Broad Subject Area of your request: Select One Area & Cultural Studies Arts Business Education Health History Humanities Language & Linguistics Media, Communication & Journalism Science & Engineering Social Science Social Sciences Special Collections Other/Not sure Tell us about the topic you are researching. Please be as specific as possible. What kind of information are you looking for? What steps have you taken so far in researching this topic?* Please give 3 dates and times you'd be available to meet. Submit Quick Links Request a Data Services consultation Request a Digital Scholarship Services consultation Request a Data Studio appointment Find a subject specialist Chat with us \u2421",
"departments":["Humanities & Social Sciences","Science & Engineering","Business & Government Information Services","Collections & Research Services"],
"collection":"services",
"site_domain":"http://dev.library.nyu.edu",
"type":"form",
"info":"",
"sections":["Request a Consultation","Get help from a librarian in your subject area","Quick Links"],
"title":"Request a Consultation",
"stringified_departments":["Humanities & Social Sciences","Science & Engineering","Business & Government Information Services","Collections & Research Services"],
"popularity":1,
"external_id":"8d08856016eed1d81da9862b03685e19bba8d239",
"card_html":" <div class=\"item item--without-thumb\"> <h2 class=\"item__title\"> <a href=\"/services/teaching-learning/learning/consult/request-consultation/\" title=\"View more info on Request a Consultation\">Request a Consultation</a> </h2> <p>Get help from a librarian in your subject area</p> </div>",
"image":"",
"url":"http://dev.library.nyu.edu/services/teaching-learning/learning/consult/request-consultation/",
"published_at":"2016-07-15T07:57:46Z",
"updated_at":"2016-07-12T20:50:39Z",
"_index":"55c5390cd3b687dbc9000012",
"_type":"55c5390cd3b687dbc9000014",
"_score":6.1400206e-05,
"_version":null,
"_explanation":null,
"sort":null,
"highlight":{
"body":"Madrid Paris Prague Shanghai Other Broad Subject Area of your request: Select One Area &amp; Cultural Studies Arts Business Education Health History <em>Humanities</em> Language &amp; Linguistics Media, Communication &amp; Journalism Science &amp; Engineering Social Science Social Sciences Special Collections Other&#x2F;Not sure",
"stringified_departments":"<em>Humanities &amp; Social Sciences</em>"
},
"id":"5787a809c75d07171bf3901b"
}]
},
"info":{
"page":{
"query":"Humanities & Social Sciences",
"current_page":1,
"num_pages":1,
"per_page":5,
"total_result_count":1,
"facets":{}
}
},
"errors":{}
}
curl -X GET 'https://api.swiftype.com/api/v1/public/engines/search.json' \
-H 'Content-Type: application/json' \
-d '{
"engine_key": "'"$SWIFTYPE_ENGINE_KEY"'",
"q":"Humanities & Social Sciences",
"filters": {"page": {"collection":"services"}},
"per_page":5,
"page":1
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment