I have a list of people that live in various countries. Each person has fields for their name, address, and country they live in (Italy, France, USA, etc). Is it possible to limit the number of people for each country in Elasticsearch? I know I have options in my programming language but would be really helpful if I could, say, limit the number of people in Italy to 5,000 entries, France to 7,000 and the USA to 10,000. Each country is a field. So, if I have 5,000 people that live in Italy and I try to enter a record for Mary that lives in Italy, then it will not be able to. Is that possible in Elasticsearch? My problem is that I have to retrieve the count everytime I want to insert a record and that is taking a lot of time and slowing my program down when all I really need is to set a maximum in elasticsearch to take care of it.
Asked
Active
Viewed 18 times
0
-
Why do you have such a limitation what is business case to limit users and not allowing to insert new? – Vova Bilyachat Aug 30 '17 at 02:52
1 Answers
0
You could have a look to Alerting but as soon as I understand its just alerting.
On the other hand this will slow down ES too, if it's possible to do what you need, because each time before index you need to count.

Vova Bilyachat
- 18,765
- 4
- 55
- 80