-
Notifications
You must be signed in to change notification settings - Fork 4
XCRI CAP Aggregator Search API Description
XCRI-CAP Search API
Direct access to the XCRI-CAP Search Interface is available at the following URL: http://coursedata.k-int.com:9200/
The generic ES documentation can be found here: http://www.elasticsearch.org/guide/reference/api/. Searching using this REST interface makes use of the lucene query language. The results of any query against ES are returned as JSON. The specifics of the XCRI-CAP implementation are:
The top level ES collection is called "courses", and the primary type for searching is "course" This gives a base URL for searching XCRI-CAP course submissions:
http://coursedata.k-int.com:9200/courses/course
Add the ES _search endpoint on to this, and you have a search that will return every public course in the system: http://coursedata.k-int.com:9200/courses/course/_search
Add additional restrictions using the ES q parameter.
For example to search for courses containing the word painting: http://coursedata.k-int.com:9200/courses/course/_search?q=painting
ES uses the standard lucene query syntax for it's q parameter, and the following are some of the primary access points:
-
provtitle - Provider Name. Use quoted strings for phrases. For example [q=provtitle:"Adam Smith"](http://coursedata.k-int.com:9200/courses/course/_search?q=provtitle:"Adam Smith"&pretty=true) (remove the pretty=true in production).
-
provid - A more reliable way to identify all records from a particular institution. The application uses this internally. You need to look-up the identifier before using.q=provid:94a535a2-08e5-4283-bcf9-4d9be87e24da.
-
identifier - The top level identifier for course : q=identifier:"uri:AdamSmithCollege:xcri:94a535a2-08e5-4283-bcf9-4d9be87e24da:INTPAT"&pretty=true
-
title - Course Title : q=title:"painting"
-
description - Course Description :q=description:"Painting"
A full list of access points can be found on the XCRI Elastic Search Access Points page.
In fact, it's possible to search on any property stored in the system. For example, given the record below, to search for all courses being delivered at the venue "Priory Campus" you would use [presentations.venue.name="Priory Campus"](http://coursedata.k-int.com:9200/courses/course/_search?q=presentations.venue.name="Priory Campus"&pretty=true).
You can combine these specifiers. For example courses running at Priory Campus, starting on or after 2008, about painting: [presentations.venue.name="Priory Campus" AND presentations.start:["2008" TO *] AND title:painting](http://coursedata.k-int.com:9200/courses/course/_search?q=presentations.venue.name="Priory Campus" AND presentations.start:["2008" TO *] AND title:painting&pretty=true)
{
"_id": "4f563b78e4b0642bf5e51881",
"lastModified": 1331051384693,
"provid": "5445bf24-4cff-4a2e-adb9-a1eef450762e",
"provtitle": "Adam Smith College",
"provloc": {
},
"provuri": "",
"identifier": "uri: AdamSmithCollege: xcri: 5445bf24-4cff-4a2e-adb9-a1eef450762e: Q2PD",
"title": "SVQ Level 2 Painting and Decorating (Construction)",
"imageuri": "",
"qual": {
"type": "",
"title": "SVQ Level 2",
"description": "",
"level": "",
"awardedBy": "",
"accreditedBy": ""
},
"description": "",
"descriptions": {
},
"aim": "",
"syllabus": "",
"careerOutcome": "",
"prerequisites": "",
"leadsTo": "",
"credits": [
],
"presentations": [
{
"identifier": "2009/2010/Q2PD/B1/A/09",
"start": "2009-08-24",
"end": "2010-07-02",
"studyMode": "Block Release",
"venue": {
"identifier": "asc: PrioryCampus",
"name": "Priory Campus",
"street": "Victoria Road",
"town": "Kirkcaldy",
"postcode": "KY1 2QT"
},
"entryRequirements": [
]
}
],
"url": "http: //www.adamsmith.ac.uk/student/courses/course/Q2PD",
"subject": [
"Construction&Property(BuiltEnvironment)"
],
"subjectKeywords": [
],
"recstatus": "public"
}