Sphinx Search for database driven websites
Copyright 2010, Richard Carson (email@example.com)
This software is available under the GPL
This search method uses a regular expression search of a character tree, and gives each object a weighted score.
Scores are determined by string length, where matches of 1 char is 1 point, 2 chars are 10 points, 3 chars are 100 points, etc
A value of 1001, or 101 is a good starting point
Objects below the minimum score are dropped, and the rest are sorted by score.
Please note that depending on the minimum score, some queries may be too short.
Use the GetShortestGood method to determine the minimum length a query string must have
The dataset must be in the form of:
SetScore($score) //Set the minimum score
GetScore() //Get the current minimum score
SetData($Dataset, $checkit=true) //Set the dataset, verification of dataset formatting is optional, and on by default
GetData($index=-1) //Get the current dataset, or the object at index
Search($Query, $debug=false) //Perform a search, debug mode is available.
GetShortestGood() //Get the shortest query length that can return results