SproutCMS

This is the code documentation for the SproutCMS project

class Search

Functions for front-end search indexing

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-15
**/
class NewClassName extends Search {
    
    /**
    * Set the 'query_and' parameter, which defines the handling of search terms
    **/
    public function queryAnd ($val) {
        // Method code goes here
    }
    
    /**
    * Does a query for a term, against a set of search handlers
    **/
    public function query (string $query, array $search_handlers, int $page, int $num_per_page) {
        // Method code goes here
    }
    
    /**
    * Return HTML to perform pagination.
    * 
    * $curr_page The current page number (1-based).
    * $num_page The total number of pages.
    * $div_class If provided, a wrapper div will be generated, with this class name.
    **/
    public function paginate ($curr_page, $num_pages, $div_class) {
        // Method code goes here
    }
    
    /**
    * Clears the index chosen with selectIndex()
    **/
    public function clearIndex () {
        // Method code goes here
    }
    
    /**
    * Splits up text, and adds the keywords which are found into the index chosen with selectIndex()
    * Usually should be run from within a transaction
    **/
    public function indexText (string $text, float $relevancy_multiplier) {
        // Method code goes here
    }
    
    /**
    * Splits up html, and adds the keywords which are found into the index chosen with selectIndex()
    * Usually should be run from within a transaction
    **/
    public function indexHtml (string $text, float $relevancy_multiplier) {
        // Method code goes here
    }
    
    /**
    * Accepts an array of relevant words and adds it into the index chosen with selectIndex()
    * Usually should be run from within a transaction
    **/
    private function addWordsIndex (array $words, int $relevancy_multiplier) {
        // Method code goes here
    }
    
    /**
    * Looks for syncronisation errors in the indexes and fixes them
    **/
    public function cleanup ($reference_table) {
        // Method code goes here
    }
    
    /**
    * Selects the currently active index
    **/
    public function selectIndex (string $table, int $record_id) {
        // Method code goes here
    }
    
}
?>