Hi Mahmoud, I apologize for the late response here, but I also encountered this same error a while ago when upgrading an arches database to Arches 5. I was also concerned about just changing the maximum number of buckets, but did do it just as you have and everything has run fine since then, though frankly I couldn't know if performance is affected because it never worked before the change...
I've had a look back at the original error messages I encountered, and it's interesting that I had the same amount of buckets as you, 15,011. One thing that Rob suggested to me was looking at the "Search Results Grid" in System Settings UI or at the TIMEWHEEL_DATE_TIERS in settings.py, or perhaps the "Hexagon Grid Precision". So, some of those settings may reduce the number of buckets, but I don't think I looked very deeply into them.
As these are aggregation buckets of some kind, I would guess that the number of resources doesn't really have anything to do with it, per se.
Interested to know if you have found anything new related to this issue. We should probably put a note in it ES installation docs.
Adam