elasticsearch/elasticsearch — pull request #6657 by alexksikes (2014-06-30 19:17:42+00:00)
Title: More Like This: ensures selection of best terms is indeed O(n)

Previously the size of the priority queue was wrongly set to the total number
of terms. Instead, it should be set to 'maxQueryTerms'. This makes the
selection of best terms O(n), instead of O(n*log(n)).

Jira patch: https://issues.apache.org/jira/browse/LUCENE-5795