On 8 January 2013 17:48, Harshvardhan Ojha
<harshvardhan.o...@makemytrip.com> wrote:
> Sorry for that, we just spoiled that thread so posted my question in a fresh 
> thread.
>
> Problem is indeed very simple.
> I have solr documents, which has all the required fields(from db).
> Say DOC1,DOC2,DOC3.....DOCn.
>
> Every document has 1 night tariff and I have 180 nights tariff.
> So a person can search for any combination in these 180 nights.
>
> Say a request came to me to give total tariff for 10th to 15th of jan 2013.
> Now I need to get a sum of tariff field of 6 docs.
>
> So how can I keep this data indexed, to avoid search time calculation, and 
> there are other dimensions of this data also beside tariff.
[...]

I think that you might be making this more complex
than it needs to be. To start with, have you tested
the response time for a search, plus adding the tariffs
for the returned results, to see if this meets your needs?

It is not feasible to pre-calculate, and cache the results
of all possible combinations of 1,2,3,...180 nights from
a set of 180 nights. And, that would be just one hotel.
What if the user wanted to search for a date range on
a chosen set of hotels?

I would suggest starting by defining the full extent of
what you need, and to decide on acceptable response
times which would be driven by business imperatives.
You might need to compromise on some things to make
this feasible. E.g., if rather than having separate tariffs
for each day, you could do with daily, weekly, monthly,
etc., rates.

Regards,
Gora

Reply via email to