How to do full text search in MongoDB

Sun, Mar 27, 2011

MySQL has had a pretty decent full text search engine in it's MyISAM storage engine and for some developers it's probably still a pretty big reason for sticking with MySQL (for some functionality at least).

Somebody published this link to the The MongoDB blog on Hacker News, just now, so I wanted to share it here. The article is actually from 2009 but it explains how to go about creating a full text search using Mongo. Even though this is a very simple example, it might help some people who rely on MySQL for some basic functionality.

However, like the author points out, it doesn't have features like text stemming, ranking of queries matching n number of terms, bulk index building. More over it doesn't do what MySQL does so well for foreign character sets: match words like ísland and island as the same (a big *win* feature of MySQL in my books)

But it would be interesting if somebody would implement that, even though just for fun. Maybe I should, but I'm not really in the mood atm.

Check out the full article: Full Text Search in Mongo - MongoDB.