Elasticsearch Crowdsource API

Setting Up the Data

Create an Index

POST - http://dunatis.library.illinois.edu:9200/{index_name}

Create a Document

POST - http://dunatis.library.illinois.edu:9200/{index_name}/{doc_type}/{id}

Elasticsearch stores all data as documents.

A document is uniquely identified by a combination of its index_name, doc_type, and id.

Each of our assets is a document, and each time a categorize event is submitted, it is stored as a separate document of type "category," index "categorize," and an auto-generated id.

This request takes a json document as input.

(The id is optional. If you leave it out, Elasticsearch will automatically generate an id for the document.)

Example POST url:

http://dunatis.library.illinois.edu:9200/categorize/asset/1234

Example json:

{ "Name": "ExampleAsset", "Url": "http://example.url" }

Bulk Loading Documents

POST - http://dunatis.library.illinois.edu:9200/{index_name}/{doc_type}/_bulk

This request takes a json document as input.

Example POST url:

http://dunatis.library.illinois.edu:9200/categorize/asset/_bulk

Example json:

{"index":{"_id":"1"}}

{"Name": "DIL19720801.2.29.2","Url": "http://idnc.library.illinois.edu/cgi-bin/imageserver/imageserver.pl?oid=DIL19720801.2.29.2&color=all&ext=jpg&area=2&width=700" }

{"index":{"_id":"2"}}

{"Name": "DIL19661012.2.12.2","Url": "http://idnc.library.illinois.edu/cgi-bin/imageserver/imageserver.pl?oid=DIL19661012.2.12.2&color=all&ext=jpg&area=7&width=700" }

{"index":{"_id":"3"}}

{"Name": "DIL19640213.2.16.1","Url": "http://idnc.library.illinois.edu/cgi-bin/imageserver/imageserver.pl?oid=DIL19640213.2.16.1&color=all&ext=jpg&area=11&width=700" }

{"index":{"_id":"4"}}

{"Name": "DIL19691217.2.22.2","Url": "http://idnc.library.illinois.edu/cgi-bin/imageserver/imageserver.pl?oid=DIL19691217.2.22.2&color=all&ext=jpg&area=1&width=700" }