Search users based on degree of connections - for typeahead functionality

I have implemented term search based on nGrams/Filters/tokenizers for
typeahead functionality . Where user types parts of name and it brings up
users matching to the typed text.

But I have requirement around data modeling and implementation, for when
someone (user A) searches other users . It should bring users matching to
his/her term based on following order.

  • People whom I follow
  • People who follow me
  • Everyone else.

Has anyone solved this problem using elastic search?. If yes what should be
the data model and mappings?


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit