Erwinwinder feature/aggregate threshold

 #1903 , refactored to restrict the server side changes to the decorator and leave elastic search service alone.