BK trees are designed for such a case. It works with metric distance, such as Levenshtein or Jaccard index.
I am answering myself here in case anyone faced this problem, to get accurate shares count use this request : page-id_post-id?fields=shares P.S. this answer by "Shayne Xin Wang" from Facebook Developer Community. ...