ElasticSearch API examples - prasadtalasila/BITS-Darshini GitHub Wiki
POSTMAN is used to construct requests quickly, save them for later use and analyze the responses sent by the API. Postman can dramatically cut down the time required to test and develop APIs.
URL: http://localhost:9200/protocol/info/_search
Type: POST
Body: {
"from": 0, "size": 200,
"query" : {
"match_all" : {}
}
}
URL: http://localhost:9200/protocol/credentials/_search
Type: POST
Body: {
"from": 0, "size": 200,
"query" : {
"match_all" : {}
}
}
- This is a unique <id> created at the initialization of the experiment. This will be of the form of a random number like
AVvNAQ9hL96eGG-XF3-R
here:
URL: http://localhost:9200/protocol/info/AVvNAQ9hL96eGG-XF3-R (The id of the experiment)
Type: POST
Body: {
"from": 0, "size": 200,
"query" : {
"match_all" : {}
}
}
- Get the <id> from the
_source
term of a particular experiment (which can be obtained by the above request) - The <id> will be of the form
session_*
- For example <id> is
session_827581779
. Attach aprotocol_
and perform the query as follows.
URL: http://localhost:9200/protocol_session_827581779/_search
Type: POST
Body: {
"from": 0, "size": 200,
"query" : {
"match_all" : {}
}
}