5 ms·
IMDB had (not sure about current situation) an elegant but not so sophisticated solution for movie search on their website They generated lot of json files wit
by praveen9920 6y ago
IMDB had (not sure about current situation) an elegant but not so sophisticated solution for movie search on their website
They generated lot of json files with all the permutations of alpha numerics upto three characters( like a.json, b.json, aa.json, sta.json), when user types initial character they fetch the corresponding json which has more relevant results.
They do "actual" search only after three characters but most of the time you would find the result in first three characters. This is not a full-text search but has its own advantages.
Bloom filters seems to have similar advantages.
- sudhirj 6y agoFor those who want to do something like this, the word / library you'll need to search for is "trigrams". Make trigrams of all your relevant search terms, then run a job to populate a JSON to your S3/CDN for each of the trigrams, with the most relevant documents sorted inside each one. You have a theoretical max of 26x26x26 = 17K files, but usually many possible trigrams aren't used in English. Can keep modifying the list over time to take into account, recency, new data, etc. But this is a pretty scalable solution for the most part. Rebuilding your entire index on S3 should still cost you less than a dollar.