Answer the question
In order to leave comments, you need to log in
How to organize the search and storage of posts by hashtags?
An example on Twitter, when you put the # symbol, the site understands that this is a tag, highlights it with a link and searches for tweets that also contain this tag.
How to organize this using Mongo as an example?
The only thing that comes to mind is to parse for the presence of a hashtag at the stage of creating a tweet and save it in the same model. But then searching for posts by tags will be super slow and resource intensive. How then to do?
APD: in general, such an option: create a model for hashtags, and there add all the tweets that contain it. Hashtags will be in the index, the speed should be good (and then you can attach an elastic if necessary). Will it go?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question