M
M
Mikhailo Poberezhny2017-04-20 13:36:14
Node.js
Mikhailo Poberezhny, 2017-04-20 13:36:14

How to sort by date in elasticsearch?

I have a Users table, in elastic I make a selection on it.
I have a field in each object that contains an array of dates:

event: {
  _id: <user id>,
  dates: [..., {dataFrom: <dateFrom>, dateTo: <dateTo>}]
}

It is necessary to sort so that the array of events objects is lined up by the nearest date

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2017-04-21
@RidgeA

https://www.elastic.co/guide/en/elasticsearch/refe...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question