Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Instant Word Search : Something I wrote for fun (instantwordsearch.com)
2 points by kirubakaran on Aug 31, 2007 | hide | past | favorite | 7 comments



If you're actually into making this more awesome, you almost certainly want to put this together with some in-memory data structure. And that data structure should probably be a suffix tree/trie. Check it out: http://en.wikipedia.org/wiki/Suffix_tree. You'd need to modify that to deal with having more than one word, but that's not too bad (you just lay the trees on top of each other).


Thanks a lot!


It is silly, really. But I just thought I'll share anyway.


Not so instant for me :-P


I found the same. You must be using LIKE across the whole dataset?

Why not build a hash table with every two-letter combination as they keys and the index of every word containing that combination as the value? That should narrow down the number of words you have to search through for each query, and it could all be done in MySQL with a many-to-many relation.


I use a text file (not db). I too thought that partitioning it would give a better performance. But profiler disagreed.

I use nearlyfreespeech.net, and they don't support FastCGI yet. Thats the bottleneck.

I am planning to try this in EC2... to see what happens.


It is much faster now.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: