2

There is a search box in header navigation bar (http://www.imdb.com/) and when I type 2 (or 3) letters fast, for less than half a second, I can see 6 results coming out!!??

Does anyone have any idea how can one search a large amount of data and get the result with a picture. :)

Are the data read from RAM ?

If you don't know for IMDB, this question is about quick search with a large number of data in general (IMDB is just very fast search I found so far), if anyone has any experience with this, it would be of great help to tell me the best way to do such a thing.

Thanks in advance.

BenH
  • 2,100
  • 2
  • 22
  • 33
tasmaniski
  • 4,767
  • 3
  • 33
  • 65

2 Answers2

6

I do not know much about, but from my investigation, they do the calculations on a different server. further more, they are all precompile as "json" files.

if you go to: "http://sg.media-imdb.com/suggests/a/all.json" all the suggestions for the query "all" (the a in the /a/all is the first letter of the query, so for "hello" it would be /h/hello.json)

Delusional Logic
  • 808
  • 10
  • 32
  • I tried the URLs you provided but I always get an "AccessDenied" XML response. – Tony Sep 23 '11 at 23:13
  • I forgot to add a ".json" to the end, so the real URL is http://sg.media-imdb.com/suggests/a/all.json sorry about that. It takes around 58ms for each queury to that server. and they can not do spaces. – Delusional Logic Sep 24 '11 at 11:03
  • First of all, I am sorry for the late reply. Good job Delusional Logic, I think this is the answer :) thanks for your replies. – tasmaniski Sep 30 '11 at 14:21
  • i doubt they are precompiling all of those files for every possible combination they are more likely using a cache solution that keep popular search terms ready for use likely something similar to memcache in .net although i dont know for sure what they are using on their servers at imdb – Chris McGrath Jan 31 '13 at 08:21
0

Im just guessing, but I'm suspicious the imdb apps (iPhone, iPad) use some kind of offline (local) search initially. I'm going to look into it...

Antony Stubbs
  • 13,161
  • 5
  • 35
  • 39
  • It would be great! Thanks for the interest in this. I am finishing the similar search on my web. if it work's as fast as IMDB's search, I will write that how I did it... – tasmaniski Dec 06 '11 at 08:45