Answer the question
In order to leave comments, you need to log in
What is the search for dialogues in the messenger?
I would like to understand in general terms how the search for dialogues is arranged, which is in all popular instant messengers (VK, telegram, etc.).
I would be grateful if you share the resources known to you on this issue (articles, books, conferences, etc.)
Answer the question
In order to leave comments, you need to log in
A quick search is always carried out by an index - a specially prepared data set containing only the key data for the search task, in a compressed format, and marked in a certain way for quick access to the record.
Indexes today are fully serviced by special search engines, of which there are many on the market. Bicycles are not needed here.
There can be many indexes - this way you can isolate non-overlapping data sets, and avoid large "common" indexes.
If the performance of one server is not enough, clusters are used - index search lends itself well to clustering.
To update the indexes, you need to periodically re-index - read the full data set and fill the index with them. This is a very difficult process, so it is usually done rarely and at a lightly loaded time for the service.
In order to be able to search taking into account any rights and statuses of messages, these rights and statuses are stored in the same index as attributes, and participate in the search query. This way you can personalize your search.
In order for the indexes to work as in real time and correspond to the application data, hooks are hung on the application: the user hid the message - the hook worked and re-indexed only this one message, which practically does not give a load.
Look for Vc on Habré how they covered this topic. They even created something and posted it to the public
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question