Global search in website using php & mysql -


i want implement search option in page header. results contain records contain filter text.e.g. products. what best way implement global search in website.

there different approaches:

  • use like queries in mysql (very bad idea, no efficiency, no relevance)
  • use full-text search in mysql (works 3 characters, partly relevance)
  • use sphinx search, full-text search mysql support
  • use search engine, elasticsearch or solr

i recommend sphinx search. useful:

sphinx full-text search engine, publicly distributed under gpl version 2. commercial licensing (eg. embedded use) available upon request.

technically, sphinx standalone software package provides fast , relevant full-text search functionality client applications. specially designed integrate sql databases storing data, , accessed scripting languages. however, sphinx not depend on nor require specific database function.

applications can access sphinx search daemon (searchd) using of 3 different access methods: a) via sphinx own implementation of mysql network protocol (using small sql subset called sphinxql, recommended way), b) via native search api (sphinxapi) or c) via mysql server pluggable storage engine (sphinxse). (http://sphinxsearch.com/docs/current.html#about)


Comments