Description
If a query requests facets with a 'contains' check, DocValuesFacets converts each term's ordinal to a BytesRef, does the string match and then checks whether it has a high enough count to go in the priority queue.
This patch moves the lookup after the min check so that we don't do it for all terms.