Answer the question
In order to leave comments, you need to log in
In what form is it best to store an interval schedule in the database / Elasticsearch in order to make various kinds of selections?
Hello, the UI for adding a schedule looks something like this:
At the output, we have this json
[
{
"times": [
{"start": "10:00", "end": "11:30"},
{"start": "14:00", "end": "15:30"},
{"start": "16:00", "end": "17:30"}
],
"dates": {
"start": "21.10.2017",
"end": "25.10.2017"
}
]
Answer the question
In order to leave comments, you need to log in
If you remove the characters from the beginning and end of the line, then everything works
^(.*)total processes:[ \t]+[0-9]+
It used to be scolded for the fact that languages \u200b\u200band libraries are wasteful of memory - they don’t save it. Now they are scolded for being wasteful with services / technologies - slap sql, slap nosql and you're done.
The task described is not architecturally significant, it is a matter of designing your code. Why not store the date/time in a linear format, like UNIX_TIMESTAMP for example? In this space, the described tasks are easily solved even on a regular calculator, not to mention elasticsearch...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question