Ouzi fulltext search engine for PHP 5

Ouzi FTS is a php5 script that I use to perform fulltext searches within multiple tables on a database, and/or within files on your server, and to get combined results ordered by relevance.
It runs with little memory, handles words proximity and PCRE regular expressions.

Author : Rosgovas J.
Date : 2007.01.25
Version : 0.9
Conditions of use :
If you use this script, please make a link on your homepage to :
http://www.lexeek.com/

DOWNLOAD:

Ouzi Fulltext search engine (zip archive)
Ouzi Fulltext search engine (tar.gz archive)

FEATURES:

  • Designed to run with little memory and order results by relevance
  • Implemented: modulable relevance algorithm
  • Implemented: relevance also depends on word proximity
  • Implemented: handles regular expressions in query
  • Implemented: search in files from a given directory and its subdirs
  • Implemented: search within multiple tables from a Mysql DB >3.2
  • Implemented: search within a 2-tables INDEX-CONTENT data structure from a Mysql DB(1)
  • Implemented: combined results from a DB search and a search in files
  • NOT implemented: search within JOIN tables

(1)* In a 2-tables INDEX-CONTENT data structure, you may use Table 1 to index Table 2 elements.
ie : Table 1 has a unique id and indexes documents whose paragraphs are stored in Table 2 ; Table 2 also has a unique id, and is used to store text paragraphs in a field with a parent id field matching Table 1 id.

INSTRUCTIONS:

Basically you may :

  1. copy “ouzi_FTS.php5″ anywhere in your tree
  2. open it and complete the configuration array
  3. include the file from your script
  4. call the FTSPHP function(2)

(2)* The main function

  • Complete the config array with your settings
  • Call FTSPHP with its attributes like this :
    • $nb_results=FTSPHP($FTSPHP_config,$FTSPHP_c[,mode][,query]);
    • query : if $query is empty, will try to get $_GET[”s”] from url
    • mode :
    • 1= DB search (one table)
      2= DB search (2 tables index-content data structure)
      4= search in files
      5= 1+search in files
      6= 2+search in files

  • Results are stored and can be accessed through $FTSPHP_c[”results”]

Example :

<?
$nb_results=FTSPHP($FTSPHP_config,$FTSPHP_c,5,"my query");
echo "Results :: " . $nb_results . "<pre>";
print_r($FTSPHP_c);
echo "</pre>";
?>

Some comments are interesting along the script for users to read.

If you use this script, don’t forget to mention it on your homepage with a link or to make a link on your homepage to http://www.lexeek.com/

Author : Rosgovas J.
Date : 2007.01.25
Version : 0.9
Conditions of use :
If you use this script, please make a link on your homepage to :
http://www.lexeek.com/

DOWNLOAD:

Ouzi Fulltext search engine (zip archive)
Ouzi Fulltext search engine (tar.gz archive)

SUUPORT:
If you need support or help, please leave a comment on this post and I’ll try to answer.


Ouzi Tags

Related content