I am trying to implement a system where one of the fields, (say count) is to incremented +1 via updates but is supposed to be constrained to have a maximum value of let's say 100. I have tried googling and have found nothing. Do these kind of updates need to be done through a painless script perhaps which will check against the current value before updating count? Or is there a way elasticsearch can take a "max" constraint for this field?
Any answeres will be highly appreciated!
Thanks