jest has asked for the wisdom of the Perl Monks concerning the following question:
I have a database app running on MySQL. Most of it is running very nicely, but my big problem is that I need to execute fast fulltext searches against one of the tables, and the built-in MySQL fulltext capability just isn't fast enough for common words.
The table in question has about 3M rows, and the relevant field averages maybe 20-30 words. It's perfectly fine when searching for not-extremely-common words, but I need to be able to search on anything (I've changed the minimum-word-length to 2 characters, and eliminated the stopword list). Doing searches for phrases like "the thing is" or "he said" can take many seconds or even minutes, and this is not an artificial need, but a common search that the app must be able to handle.
Most of the things I've looked at for fulltext searches are concerned with things like stemming, or fuzzy matching, or result ranking. I'm interested in none of those things, I only want an exact result quickly. I tried for example DBIx::FullTextSearch, but, while superficially appealing, this (1) took 250 times longer to build the indexes than in the MySQL built-in, and (2) didn't really run any faster (it was hard to benchmark, but if there was a difference it was slight).
I also looked at the Vector Space search engine, and the Perlmonks discussion of it, and while this looks really cool, it didn't seem as if that was especially fast either, and besides I don't have the math chops to really get this working.
I haven't tried the recent perl.com article on Adding Search Functionality to Perl Applications, but it seems that that's geared more towards stemming and ranking than in raw speed.
Does anyone have a suggestion? I know most people aren't trying to match "in it", but some people are, and Google can do it quickly, and I hope there's a way of accomplishing this.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Fulltext DB search: The Need for Speed
by kvale (Monsignor) on Oct 27, 2003 at 18:47 UTC | |
Re: Fulltext DB search: The Need for Speed
by Abigail-II (Bishop) on Oct 27, 2003 at 15:57 UTC | |
by jest (Pilgrim) on Oct 27, 2003 at 16:08 UTC | |
Re: Fulltext DB search: The Need for Speed
by perrin (Chancellor) on Oct 27, 2003 at 17:42 UTC |