tags:

views:

47

answers:

3

I want to do full text search efficiently in MYSQL using match against. Specially I need to use binary operators(eg. match some text but not other text). However I also need efficient transaction support.
But full text search is only supported on MYISAM, not Innodb. What to do?

+1  A: 

Assuming you need to use Innodb.

I'd suggest using an external search tool - sphinx or solr would get my vote. Both of them consistently return better results than mysql fulltext search, and much faster. I'd say sphinx is easier to get up and going with, especially coming from mysql.

If you can't install either of them, or just don't have time, at a push, you could either move or duplicate just the necessary fields in a myisam table so that you can use mysql's fulltext search.

benlumley
good advise, but I can't move or duplicate tables/columns, I need to delete the matching results after search, preferably done in a single SQL statement.
+1  A: 

This is a suggestion rather than answer.

If you're going to have a large database or want advanced features, don't use mysql's full-text search. You can use sphinx or lucene.

SPhinx is generally faster and lighter, but Lucene has much more features. I personally use Sphinx.

TIMEX
Use Lucene, since Lucene is Java-based.
TIMEX
sphinx is php only right?
You can use any language with lucene or sphinx. It's the fact that "setting it up", lucene is java-based.
TIMEX
can insertion and update be done without going through them? how can "any language" use them? will they be updating the indices constantly?
A: 

You can also try Ferret it is a ruby-implementation of an apache searching library. According to speed tests, it is also much faster.

Maz