PHP Classes

Multisources Search Engine: Search data on MySQL, XML, INI or flat files

Recommend this page to a friend!
  Info   View files Example   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 520 This week: 1All time: 5,707 This week: 560Up
Version License PHP version Categories
mse 1.0MIT/X Consortium ...5.0PHP 5, Databases, Searching
Description 

Author

This class can search data on MySQL, XML, INI or flat files.

It provides separate functions to search different sources of data according to parameters defined in a separate configuration class.

For MySQL database tables, it can search a given MySQL database using PDO to execute a query on a given table matching records that have the search keywords.

For XML search it reads a given XML document and searches for given elements with the search keywords.

For INI files, it parses the INI file into an array of options and values, and finds the search keywords in the array.

For flat files, it reads the whole file into a string and finds the search keywords in the string.

For database, INI and flat files, the matching of the search keywords can be by equality, contained words using LIKE, or similarity with the LEVENSHTEIN or SOUNDEX functions.

Innovation Award
PHP Programming Innovation award nominee
November 2014
Number 2


Prize: One copy of the Zend Studio
Most applications need to provide a search functionality to let the users search for the information they want from the applications.

This class provides a general purpose solution for searching information on multiple data sources, not only SQL databases, but also XML files, INI files or flat files.

Manuel Lemos
Picture of Ettore Moretti
  Performance   Level  
Name: Ettore Moretti is available for providing paid consulting. Contact Ettore Moretti .
Classes: 12 packages by
Country: Italy Italy
Age: ???
All time rank: 107741 in Italy Italy
Week rank: 416 Up16 in Italy Italy Up
Innovation award
Innovation award
Nominee: 3x

Recommendations

Search engine for files
Search engine for different file types

Example

<?php
require_once("SearchCore/SearchConfig.php");
require_once(
"SearchCore/Search.class.php");
if(isset(
$_POST['searchKey']) && trim($_POST['searchKey'])!='' && preg_replace("/[^0-9a-z]/","",$_POST['searchKey'])!='')
       
$out= Search::getDBSearch(preg_replace("/[^0-9a-z]/","",$_POST['searchKey']));
       
//$out= Search::getXMLSearch(preg_replace("/[^0-9a-zA-Z]/","",$_POST['searchKey']));
        //$out= Search::getINISearch(preg_replace("/[^0-9a-z]/","",$_POST['searchKey']));
        //$out= Search::getFLATSearch(preg_replace("/[^0-9a-z]/","",$_POST['searchKey']));
   
?>
<html>
<body>

<form action="#" method="post">

<span>Search (stuff):</span>
<input type="text" name="searchKey" value="" placeholder="Search key here"/>
<input type="submit" name="sub" value"Search that" />
</form>


<div class="result_container">
<?php if(isset($out)){
//Now you can format the output as you wish :)
echo "<pre>";
print_r($out);
}
?>
</div>
</body>
</html>


  Files folder image Files  
File Role Description
Files folder image.settings (4 files)
Files folder imageFILE (4 files)
Files folder imageSearchCore (3 files)
Accessible without login Plain text file .buildpath Data Auxiliary data
Accessible without login Plain text file .project Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE.txt Lic. Documentation

  Files folder image Files  /  .settings  
File Role Description
  Accessible without login Plain text file .jsdtscope Data Auxiliary data
  Accessible without login Plain text file org.eclipse.php.core.prefs Data Auxiliary data
  Accessible without login Plain text file org.eclipse.wst.js...superType.container Data Auxiliary data
  Accessible without login Plain text file org.eclipse.wst.jsdt.ui.superType.name Data Auxiliary data

  Files folder image Files  /  FILE  
File Role Description
  Accessible without login Plain text file example.ini Data Auxiliary data
  Accessible without login Plain text file example.txt Data Documentation
  Accessible without login Plain text file example.xml Data Auxiliary data
  Accessible without login Plain text file searchdb.sql Data Auxiliary data

  Files folder image Files  /  SearchCore  
File Role Description
  Accessible without login Plain text file levenshtein_function.sql Data Auxiliary data
  Plain text file Search.class.php Class Class source
  Plain text file SearchConfig.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:520
This week:1
All time:5,707
This week:560Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1653