diff --git a/ckan/templates/_snippet/data-api-help.html b/ckan/templates/_snippet/data-api-help.html index 5a499c938b8..bab65b21550 100644 --- a/ckan/templates/_snippet/data-api-help.html +++ b/ckan/templates/_snippet/data-api-help.html @@ -15,102 +15,51 @@
Access resource data via a web API with powerful query - support. Further information in the main - CKAN Data API and DataStore documentation.
+Access (and update) resource data via a web API with powerful query + support.
+ +The Data API builds directly on ElasticSearch, with a resource API - endpoint being equivalent to a single index 'type' in ElasticSearch. - This means you can directly re-use ElasticSearch - client libraries when connecting to the API endpoint.
-Query example | -
- ${datastore_api}/_search?size=5&pretty=true
- |
-
---|---|
Schema (Mapping) | -
- ${datastore_api}/_mapping?pretty=true
- |
-
Base | -${datastore_api} |
-
The following examples utilize the cURL - command line utility. If you prefer, you you can just open the relevant urls in - your browser.
- --// added pretty=true to get the json results pretty printed -curl ${datastore_api}/_search?q=title:jones&size=5&pretty=true-
A simple ajax (JSONP) request to the data API using jQuery.
@@ -119,7 +68,8 @@q: 'title:jones' // query on the title field for 'jones' }; $.ajax({ - url: ${datastore_api}/_search, + url: '${datastore_api}/_search', + data: data, dataType: 'jsonp', success: function(data) { alert('Total results found: ' + data.hits.total) @@ -128,6 +78,22 @@
+import urllib +url = '${datastore_api}/_search?size=5&q=title:jones' +fileobj = urllib.urlopen(url) +print fileobj.read() ++