I'm trying to perform a GET request to elastic search api which is needed in this form
GET /_search
{
"query": {
"more_like_this" : {
"fields" : ["title", "description"],
"like" : "Once upon a time",
"min_term_freq" : 1,
"max_query_terms" : 12
}
}
}
I used request But I can't find how to add body to the request.
Any help?
You can see the document about request(options, callback)
Also, GET method should't send any body, please confirm it's not POST.
request.get('http://localhost:8092/_search', {
json: true,
body: {
"query": {
"more_like_this" : {
"fields" : ["title", "description"],
"like" : "Once upon a time",
"min_term_freq" : 1,
"max_query_terms" : 12
}
}
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With