Wondering if you should not index availability instead of indexing rooms. (I 
don't know how your documents look like BTW)

Let's say you create documents like

{
  "hotel":"name",
  "room":"A205",
  "available": [ {
    "from": "2014-02-13",
    "to": "2014-02-14",
    "days":2 
   }, {
    "from": "2014-02-16",
    "to": "2014-02-20",
    "days":5 
   } ]
}

Could this help?
That say, I think you can compute `days` when running the query but it well be 
easier and probably more efficient to compute it at index time (so on client 
level).

WDYT? 

-- 
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr


Le 5 février 2014 at 10:33:38, Simon Leighton ([email protected]) a 
écrit:

I Asked this on stack overflow but I see searching around for some pointers 
most questions are being directed back to the ES mailing lists so here I go...

I am creating a hotel booking system using Elasticsearch and am trying to find 
a way to return hotels that have a variable number of sequential dates 
available (for example 7 days) across a range of dates

I am currently storing dates and prices as a child document to the hotel but am 
unsure how to undertake the search or if it is even possible with my current 
setup?

Thanks

Simon

--
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/ac5e1690-1c4c-4971-a35b-02237cf0add5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/etPan.52f20bd0.189a769b.d955%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to