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?

-Thanks
Rajesh

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9b34b088-8e25-4119-a252-32a9ccbcb751%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.