Reputation: 2528
I have a MYsql database containing names of books, authors and other details.
Which indexing engine can search them?
I wanted to use Sphider.
Will it work for MySQL
databases?
Upvotes: 0
Views: 2519
Reputation: 56
Solution 1: Use MyISAM table engine for your tables that contain the records you want to search. Then you can create indexes on columns you want to search and then apply full text search functions. http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html
Note: When using MyISAM you will not have transactional capabilities, and tables might get corrupted (recovery is difficult). Also, as of MySQL 5.6.4 InnoDB has full text support (though it's a new feature so it might be buggy and benchmarks are still not ample).
Solution 2: Use Sphinx search server. It is super fast and distributed search system. Sphinx will pull fields you want to index from your MySQL database and index them. Then you can either use Sphinx SQL to fetch the document IDs matching your query or use Sphinx API (provided for well known languages) to get document IDs matching. http://sphinxsearch.com/
Sphinx is super fast when it comes to indexing and query serving. It's worth taking a look at. I would recommend it.
Upvotes: 2
Reputation: 11413
If all your data is already in a mysql database, then you don't need any search/indexing engine.
Use one of the extensions available in PHP to query mysql databases: MySQLi or PDO.
Read the documentation for the extension, learn how to use the functions.
Then you will be able to write PHP/MySQL code to manipulate the data in your database.
Upvotes: 2