Can the Solr branch_5x (specifically, browsing the repo at the point of SOLR-5730's last commit) be a good place to check in regards to this task?
The team is upgrading to Solr 5 from Solr 4 for now. Im an intern and had been asked to implement these features and discovered that they already existed in SortingMergePolicy and EarlyTerminatingSortCollector. So Im just concentrating on that since that is the version the company is migrating its Solr to.