Login   Register  
PHP Classes
elePHPant
Icontem

Search by Relevance: Sort arrays or MySQL searches by relevance

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2010-11-22 (4 years ago) RSS 2.0 feedNot enough user ratingsTotal: 966 This week: 2All time: 3,481 This week: 655Up
Version License PHP version Categories  
search-by-relevance 1.0Free for non-commercial...3.0Databases, Searching, Data types
Description Author  

This class can be used to sort arrays or MySQL searches by relevance.

It can search for a string in an array of a MySQL query result.

The class returns an array of search result entries that is sorted by a criteria of relevance implemented within the class.

A number representing the relevance is returned within the sorted search results.

Innovation Award  
PHP Programming Innovation award nominee
December 2010
Number 3


Prize: One downloadable e-book of choice by O'Reilly
Sometimes it is necessary to determine which entries in search results are more relevant to the original search terms.

This class provides an effective solution to sort an array of results according to which results contain text more similar to the original search terms.

Manuel Lemos
Picture of Carlson A. Soares
Name: Carlson A. Soares <contact>
Classes: 4 packages by
Country: Brazil Brazil
Age: 26
All time rank: 60146 in Brazil Brazil
Week rank: 641 Down49 in Brazil Brazil Down
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Accessible without login Plain text file est_cid.sql Data Sql file with the database used in the teste.php
Plain text file search.php Class Class to search in array
Plain text file search_mysql.php Class class to search in mysql resultset
Accessible without login Plain text file teste.php Example Script of exemple showing the class function

 Version Control Unique User Downloads Download Rankings  
 0%Total:966All time:3,481
 This week:2This week:655Up