Hi David,

I'm pulling in the room availability for an API so I'll only get 
availability one date at a time hence why I'm thinking of using child 
documents as to not need to constantly update the hotel data in the parent. 
 Each day has an individual price so I'm trying to find the cheapest block 
of say 7 days (this is user specified so could be anywhere from 1 - 14).

Thanks
Simon





On Wednesday, 5 February 2014 10:00:48 UTC, David Pilato wrote:
>
> 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 <https://twitter.com/dadoonet> | 
> @elasticsearchfr<https://twitter.com/elasticsearchfr>
>
>
> Le 5 février 2014 at 10:33:38, Simon Leighton 
> ([email protected]<javascript:>) 
> 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] <javascript:>.
> 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/b5bead0e-4118-41cf-b18e-eaca181d78bf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to