Calculation possible?


(Remco Zwaan) #1

Hi,

This is part of a result of room X.

"prices": {
"2019-05-15": 80,
"2019-05-16": 80,
"2019-05-17": 85,
"2019-05-18": 88,
},

Each day can have a different price per room. Based on visitor client side calendar input (1,2,3 ect days selected) we want to calculate the total price and show in the listing results. We calculate now on client / runtime (ruby/rails). We have more then 1200 rooms in our inventory so calculation on runtime (ruby) is slow (+ 4 secs) and cost a lot memory.

Is there a way to calculate in ES? or other solution?

Ciao..remco


(Junaid) #2

Hi,

Didn't get your question? You can user metrics aggregation to get statistics from your documents indexed in ES. (https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics.html). I am unsure whether you were looking for something similar.


(system) #3

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