Search/indexing frontend for our ElasticSearch
GETs and POSTs are open.
PUTs and DELETEs requires a valid jwt
Returns this page
Adds a new document to index.
You'll need do supply index, type, id and the document itself in the body property. See the example
http PUT http://localhost:3000/api/documents Authorization:'Bearer ' < test/data/document.json
returns
{
"_id": "1",
"_index": "test",
"_primary_term": 1,
"_seq_no": 0,
"_shards": {
"failed": 0,
"successful": 1,
"total": 2
},
"_type": "document",
"_version": 1,
"result": "created"
}
Search indexed documents with a regular GET request
$ http GET http://localhost:3000/api/search?q=wunderbar
returns
{
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 6,
"total": 6
},
"hits": {
"hits": [
{
"_id": "1",
"_index": "test",
"_score": 0.2876821,
"_source": {
"description": "A short story about my feelings",
"title": "I feel wunderbar"
},
"_type": "document"
}
],
"max_score": 0.2876821,
"total": 1
},
"timed_out": false,
"took": 59
}
Search indexed documents with a regular GET request.
Filters by :index
$ http GET http://localhost:3000/api/test/search?q=wunderbar
returns
{
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 6,
"total": 6
},
"hits": {
"hits": [
{
"_id": "1",
"_index": "test",
"_score": 0.2876821,
"_source": {
"description": "A short story about my feelings",
"title": "I feel wunderbar"
},
"_type": "document"
}
],
"max_score": 0.2876821,
"total": 1
},
"timed_out": false,
"took": 59
}
Search indexed documents by POSTing a json request
$ http POST http://localhost:3000/api/search q=wunderbar
{
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 6,
"total": 6
},
"hits": {
"hits": [
{
"_id": "1",
"_index": "test",
"_score": 0.2876821,
"_source": {
"description": "A short story about my feelings",
"title": "I feel wunderbar"
},
"_type": "document"
}
],
"max_score": 0.2876821,
"total": 1
},
"timed_out": false,
"took": 59
}
Search indexed documents by POSTing a json request.
Filters by :index
$ http POST http://localhost:3000/api/test/search q=wunderbar
{
"_shards": {
"failed": 0,
"skipped": 0,
"successful": 6,
"total": 6
},
"hits": {
"hits": [
{
"_id": "1",
"_index": "test",
"_score": 0.2876821,
"_source": {
"description": "A short story about my feelings",
"title": "I feel wunderbar"
},
"_type": "document"
}
],
"max_score": 0.2876821,
"total": 1
},
"timed_out": false,
"took": 59
}
Deletes a given index
$ http DELETE http://localhost:3000/api/indexes/test Authorization:'Bearer <jwt-token>'
returns
{
"acknowledged": true
}
Ping for pong
$ http GET http://localhost:3000/api/ping
returns
pong