Query ideas for my usecase to find order status

Firstly sorry if i m asking elementary questions and bit long question.

So i have a need for some sort of join query ( i know Elasticsearch is not RDBMS ) so i m looking for ideas.

So here are my few sample docs.

{
"client":"A",
"type":"order",
"ordernum":"1234",
"status":"",
"ReceivedTimestamp" : "2020-03-267T14:30:51.844"
}

{
"client":"A",
"type":"order",
"ordernum":"1234",
"status":"acknowledged",
"ReceivedTimestamp" : "2020-03-26T14:31:51.844"
}

{
"client":"A",
"type":"order",
"ordernum":"1234",
"status":"shipped",
"ReceivedTimestamp" : "2020-03-27T11:00:51.844"
}
{
"client":"B",
"type":"order",
"ordernum":"4567",
"status":"",
"ReceivedTimestamp" : "2020-03-267T15:30:51.844"
}

{
"client":"B",
"type":"order",
"ordernum":"4567",
"status":"acknowledged",
"ReceivedTimestamp" : "2020-03-267T15:31:51.844"
}

{
"client":"B",
"type":"order",
"ordernum":"4567",
"status":"shipped",
"ReceivedTimestamp" : "2020-03-27T11:00:51.844"
}
{
"client":"A",
"type":"order",
"ordernum":"7890",
"status":"",
"ReceivedTimestamp" : "2020-03-27T12:00:51.844"
}

So what i m looking for is to write a query which would give me result of all orders which have not been acknowledged for client A in say last 15 mins . So if i break the query

step 1 search for all docs matching client : "A"

step 2 out of that result search for docs i i have to find ordernum which has not been in status : acknowledgement.

so should i have separate index for type order ? i.e orderindex, ackindex and shippedindex ? then do some sort of nested join ? or what ever i m trying its not possibe at all ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.