Sphinx Search/Why Use Sphinx?

From Wikibooks, open books for an open world
Jump to navigation Jump to search

You might be asking yourself, why bother use Sphinx? It seems to be more trouble than it's worth.

  • Speed: The key reason is SPEED. Your regular MySQL searches take a SIGNIFICANTLY longer time to execute than a Sphinx search. You will start noticing the difference once your database has millions of records. If you have a small database (ex: forum of 100 users), will it be of any help? Not really...It's still fun to experiment with though! Plus there are cool features like word morphology (if I am searching for cats it will match cat, if I'm searching for running it will match run, runs, runable (I think...), etc.)
  • Search Features: Another reason is search features. Ever wonder when you search for 2 words in Google, it will look for them in the same paragraph or 2 paragraphs (or sentence) but not all the way across the page? Sphinx allows you to do similar things :)
  • Scalability: If you have big big databases on many many servers Sphinx will take care of it. And it will make it seem to the application that it's looking at one server. Sphinx can take a lot of stress off the PHP servers in terms of handling and searching information.