by asmecher » Fri Oct 13, 2006 6:56 am
Hi prcgian,
Searching and indexing are implemented in classes/search/*.php using an inverted index. The keywords and indexing information are stored in the MySQL tables called search_keyword_list, search_objects, and search_object_keywords.
The algorithm works very roughly as follows: the search string is split into keywords (with a quoted phrase being treated as a single "keyword"). The numbers of results for each keyword (with a maximum number as defined in the configuration file) are added and the final ranking is calculated based on those totals.
The search algorithm itself can be found in classes/search/Search.inc.php in the retrieveResults function.
Regards,
Alec Smecher
Public Knowledge Project Team