Problem: I have a document type 'employee' with a property called 'department'. I would like to limit the number of employees in any given department to N.
Does ES provide means to enforce such a rule during document creation. If yes, what would the best way of achieving this.
Please note that using a RDBMS or some other form of storage is not an option.
This is a familiar problem, however, I am not aware of ways of achieving this in ElasticSearch. Pointers would be appreciated.
As I know there are no such constraint possible, but if you are creating array property of department, then before inserting try selecting that doc and check department count before inserting,
I see your point. Taking a look at inline scripts in ES 5.0. That said in my case it would be the department document that would need to contain the employees for I need to limit the number of employees in a department versus limiting the number of departments an employee can belong to.
If you have used inline script in ES 5.0, how did you find its performance. Any resources you can point me to would be helpful.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.