How does elasticsearch implement such a search?

using elasticsearch as a full-text search engine, we now encounter a problem. The
index data comes from the commodity table good, assumes that the search keyword "tractor" can find 100 items of data, belonging to five enterprises, each of which uploaded 20 tractor products according to its own product model.
the first 20 tractor items searched in this way come from enterprise 1, then 20 from enterprise 2, and so on.
now you want tractors from the same enterprise to display only 1-3 items, how to achieve Filter?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34d40-2bf60.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34d40-2bf60.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?