Skip to content

Commit

Permalink
Merge branch 'release-v1.7' of https://github.com/okfn/ckan into rele…
Browse files Browse the repository at this point in the history
…ase-v1.7
  • Loading branch information
rossjones committed Apr 27, 2012
2 parents 4955b0a + 4d86346 commit 4ce167c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
3 changes: 2 additions & 1 deletion doc/solr-setup.rst
Expand Up @@ -71,7 +71,7 @@ so, create a symbolic link to the schema file in the config folder. Use the late
supported by the CKAN version you are installing (it will generally be the highest one)::

sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak
sudo ln -s ~/ckan/ckan/config/solr/schema-1.3.xml /etc/solr/conf/schema.xml
sudo ln -s ~/ckan/ckan/config/solr/schema-1.4.xml /etc/solr/conf/schema.xml

Now restart jetty::

Expand All @@ -93,6 +93,7 @@ will have different paths in the Solr server URL::

http://localhost:8983/solr/ckan-schema-1.2 # Used by CKAN up to 1.5
http://localhost:8983/solr/ckan-schema-1.3 # Used by CKAN 1.5.1
http://localhost:8983/solr/ckan-schema-1.4 # Used by CKAN 1.7
http://localhost:8983/solr/some-other-site # Used by another site

To set up a multicore Solr instance, repeat the steps on the previous section
Expand Down
36 changes: 30 additions & 6 deletions doc/using-data-api.rst
Expand Up @@ -2,22 +2,44 @@
Using the Data API
==================

The following provides an introduction to using the CKAN :doc:`DataStore
<datastore>` Data API.

Introduction
============

The Data API builds directly on ElasticSearch, with a resource API endpoint
being equivalent to a single index 'type' in ElasticSearch (we tend to refer to
it as a 'table'). This means you can often directly re-use `ElasticSearch
client libraries`_ when connecting to the API endpoint.
Each 'table' in the DataStore is an ElasticSearch_ index type ('table'). As
such the Data API for each CKAN resource is directly equivalent to a single
index 'type' in ElasticSearch (we tend to refer to it as a 'table').

This means you can (usually) directly re-use `ElasticSearch client libraries`_
when connecting to a Data API endpoint. It also means that what follows is, in
essence, a tutorial in using the ElasticSearch_ API.

The following short set of slides provide a brief overview and introduction to
the DataStore and the Data API.

Furthermore, it means that what is presented below is essentially a tutorial in the ElasticSearch API.
.. raw:: html

<iframe src="https://docs.google.com/presentation/embed?id=1UhEqvEPoL_VWO5okYiEPfZTLcLYWqtvRRmB1NBsWXY8&#038;start=false&#038;loop=false&#038;delayms=3000" frameborder="0" width="480" height="389" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>

.. _ElasticSearch: http://elasticsearch.org/
.. _ElasticSearch client libraries: http://www.elasticsearch.org/guide/appendix/clients.html

Quickstart
==========

``{{endpoint}}`` refers to the data API endpoint (or ElasticSearch index / table).
``{{endpoint}}`` refers to the data API endpoint (or ElasticSearch index /
table). For example, on the DataHub_ this gold prices data resource
http://datahub.io/dataset/gold-prices/resource/b9aae52b-b082-4159-b46f-7bb9c158d013
would have its Data API endpoint at:
http://datahub.io/api/data/b9aae52b-b082-4159-b46f-7bb9c158d013. If you were
just using ElasticSearch standalone an example of an endpoint would be:
http://localhost:9200/gold-prices/monthly-price-table.

.. note:: every resource on a CKAN instance for which a DataStore table is
enabled provides links to its Data API endpoint via the Data API
button at the top right of the resource page.

Key urls:

Expand All @@ -28,6 +50,8 @@ Key urls:

* Schema (Mapping): ``{{endpoint}}/_mapping``

.. _DataHub: http://datahub.io/

Examples
--------

Expand Down

0 comments on commit 4ce167c

Please sign in to comment.