Right now the SearchHookHandler checks for the amount of sitelinks and claims using wbgetentities via the web api. This is a rather slow approach. We might consider using pageprops as in https://www.wikidata.org/w/api.php?action=query&prop=pageprops&titles=Q1|Q42|Q2013&ppprop=wb-claims|wb-sitelinks or at least use an EntityLookup (obtained from WikibaseClient).
At one point we might change this completely in favour of a solution using JavaScript or integrating it in Elastic. This will be important especially for the big Wikipedias.