banana icon indicating copy to clipboard operation
banana copied to clipboard

Nested (?) Query

Open obiwan866 opened this issue 10 years ago • 2 comments

Hi all,

Here is the problem i'm facing on : I've got a collection with the following fields : Date_Time, Marker (string), Number (int), i would like to get for a given marker, the value of number at NOW - 1 DAY, NOW - 7 DAYS and for example div(sub(Nbr,NbrD-7),NbrD-7) and put them in a table.

Any clue to do that ? Thanks.

obiwan866 avatar Mar 18 '15 12:03 obiwan866

maybe i could precise my problem :

I just would like to get on the same line the value of number for different date. if anybody would know the type of query i need for, i will be truly grateful.

obiwan866 avatar Mar 19 '15 14:03 obiwan866

Hi, it seems that the solution is to extend DocTransformer. Check here for more details:

http://lucene.472066.n3.nabble.com/Custom-Response-Handler-td4067558.html

Inside transform you can retrieve values for NOW-1DAY and NOW-7DAY, do the calculations and add fields to response as needed.

aadel avatar Mar 23 '15 22:03 aadel