class base

optional base class for search plugins providing simple caching based on ACM and functions to retrieve ignore_words and synonyms

Properties

$ignore_words
$match_synonym
$replace_synonym

Methods

search_backend($error)

No description

int
obtain_ids(string $search_key, int $result_count, array $id_ary, int $start, int $per_page, string $sort_dir)

Retrieves cached search results

null
save_ids(string $search_key, string $keywords, array $author_ary, int $result_count, array $id_ary, int $start, string $sort_dir)

Caches post/topic ids

destroy_cache($words, $authors = false)

Removes old entries from the search results table and removes searches with keywords that contain a word in $words.

Details

at line 33
search_backend($error)

No description

Parameters

$error

at line 51
int obtain_ids(string $search_key, int $result_count, array $id_ary, int $start, int $per_page, string $sort_dir)

Retrieves cached search results

Parameters

string $search_key

an md5 string generated from all the passed search options to identify the results

int $result_count

will contain the number of all results for the search (not only for the current page)

array $id_ary

is filled with the ids belonging to the requested page that are stored in the cache

int $start

indicates the first index of the page

int $per_page

number of ids each page is supposed to contain

string $sort_dir

is either a or d representing ASC and DESC

Return Value

int

SEARCH_RESULT_NOT_IN_CACHE or SEARCH_RESULT_IN_CACHE or SEARCH_RESULT_INCOMPLETE

at line 120
null save_ids(string $search_key, string $keywords, array $author_ary, int $result_count, array $id_ary, int $start, string $sort_dir)

Caches post/topic ids

Parameters

string $search_key

an md5 string generated from all the passed search options to identify the results

string $keywords

contains the keywords as entered by the user

array $author_ary

an array of author ids, if the author should be ignored during the search the array is empty

int $result_count

contains the number of all results for the search (not only for the current page)

array $id_ary

contains a list of post or topic ids that shall be cached, the first element must have the absolute index $start in the result set.

int $start

indicates the first index of the page

string $sort_dir

is either a or d representing ASC and DESC

Return Value

null

at line 229
destroy_cache($words, $authors = false)

Removes old entries from the search results table and removes searches with keywords that contain a word in $words.

Parameters

$words
$authors