7

I need some help in designing car booking application. There is a document with information about car (title, model, brand, info, etc.)

Problems I'm stuck with are:

  1. How to store available booking days? (I suppose I could use nested free date range objects in array)

  2. How to store price per day (it's possible to have individual price per day)?

  3. Booking days and prices could change often. So the third question is: "how to update them cleverly (partially), so I shouldn't read the document, and then store it". I'm looking at script solution using update api (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html), but it looks ugly. Maybe there are other approaches?

Thanks, Alex

Alex
  • 1,210
  • 8
  • 15

1 Answers1

0

with the introduction of the range datatypes, there is no need to use a real nested object, if you meant that.

That might also help you with storing the prices, but that could just be any object I suppose (it depends if you want to search for that as well).

Update API was made for exactly that use-case, that you do not need to get the whole document, so that shounds like a plan.

alr
  • 1,744
  • 1
  • 10
  • 11