neel.1708
neel.1708

Reputation: 315

Forum Search engin to search keywords in database in php

I am developing a intranet forum in Php and MySQL and I am using ajax to display searched results on the same page but right now I am using query LIKE text% to search in database which is slower. but I want to make it fast search engin which can parse *,+ and show result.

Since I am using ajax i am not able to use free search engin,so if possible pls provide a complete solution

Upvotes: 1

Views: 542

Answers (3)

Packet Tracer
Packet Tracer

Reputation: 3924

If you need to search in a lot of tables of your database, and those are big you should use a text search engine such as Solr, Lucene or Sphinx (as commented before).

But if you need to search only in a few tables you could use mysql full-text search capabilities. They only work on tables with MyIsan engine, but it's easy to update them everyday with an stored procedure or with a trigger each time the parent table being updated. So you don't need to install a fully powered server to use full-text searches.

Fulltext Search on dev.mysql.com

Upvotes: 1

Manse
Manse

Reputation: 38147

Have a look at the Zend Lucene -> http://framework.zend.com/manual/en/zend.search.lucene.html

Extract from website :

Zend_Search_Lucene is a general purpose text search engine written entirely in PHP 5. Since it stores its index on the filesystem and does not require a database server, it can add search capabilities to almost any PHP-driven website. Zend_Search_Lucene supports the following features:

  • Ranked searching - best results returned first

  • Many powerful query types: phrase queries, boolean queries, wildcard queries, proximity queries, range queries and many others.

  • Search by specific field (e.g., title, author, contents)

Upvotes: 0

arnep
arnep

Reputation: 6241

You could use Sphinx Search, which is an Open Source and very powerful local search engine with APIs to many programming languages and good integration with MySQL.

Here is some tutorial using Sphinx Search with PHP.

Upvotes: 1

Related Questions