I'm currently writing a website in JavaScript that graphs various fields from data in ElasticSearch, and I've run into a strange issue. (I don't want to use Kibana for a variety of reasons.)
My search query in JavaScript has been returning hits properly up until a bit ago. I made no changes to it, but suddenly the query returns no hits. However, when I follow the URL generated by the call, the hits I want appear.
Here's the query:
client.search({
index: "chamber-data",
type: "Soak1",
size: 1000,
scroll: "30s",
sort: ["_doc"],
_source: ["@timestamp", "datetime", [...this.props.fields]],
body: {
query: {
bool: {
filter: {
range: {
"datetime": {
lte: "now",
gte: "now-12H"
}
}
}
}
}
}
}).then(this.process_promise, this.handle_error);
Here is what the script gives me in the console of my website:
{
"_scroll_id": "DnF1ZXJ5VGhlbkZldGNoBQAAAAAAA1NrFlZYTEJLYW12UUFTaWowMllJZVcyalEAAAAAAANTbRZWWExCS2FtdlFBU2lqMDJZSWVXMmpRAAAAAAADU28WVlhMQkthbXZRQVNpajAyWUllVzJqUQAAAAAAA1NsFlZYTEJLYW12UUFTaWowMllJZVcyalEAAAAAAANTbhZWWExCS2FtdlFBU2lqMDJZSWVXMmpR",
"took": 0,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
And here's what the URL gives me:
{"_scroll_id":"DnF1ZXJ5VGhlbkZldGNoBQAAAAAAA1N2FlZYTEJLYW12UUFTaWowMllJZVcyalEAAAAAAANTdBZWWExCS2FtdlFBU2lqMDJZSWVXMmpRAAAAAAADU3cWVlhMQkthbXZRQVNpajAyWUllVzJqUQAAAAAAA1NzFlZYTEJLYW12UUFTaWowMllJZVcyalEAAAAAAANTdRZWWExCS2FtdlFBU2lqMDJZSWVXMmpR",
"took":9,
"timed_out":false,
"_shards":{"total":5,"successful":5,"failed":0},
"hits":
{"total":107565,"max_score":null,"hits":[...]}
}
I have absolutely no idea as to what has happened, and I have no idea how to solve it. Anyone have thoughts?