This is a request to add a TOPN flag to the JOIN() ECL function as a way of making KEEP(n) a bit smarter.
The flag would operate like KEEP(n) in that only n number of matches per LHS would be retained, but the actual records kept would be determined by the same rules that normally govern TOPN(). The syntax could be:
Where sorts is one or more attributes in the result (i.e. SELF.x, -SELF.y, etc.).
This would function the same as KEEP(5) but the actual kept matches would contain the lowest someNum values in the result rather than just the first five matched records.
Rationale: This option would save enormous amounts of processing time for certain datasets. For example, a dataset containing lat/lon values where you need to find the nearest n neighbors for every record would benefit tremendously.