phpBB API Documentation
Class

fulltext_mysql

class fulltext_mysql extends search_backend

fulltext_mysql Fulltext search for MySQL

Properties

$ignore_words
$match_synonym
$replace_synonym
$stats
$word_length
$split_words
$search_query
$common_words
$pcre_properties
$mbstring_regex

Methods

search_backend($error)

from search_backend
get_ignore_words()

Retrieves a language dependend list of words that should be ignored by the search

from search_backend
get_synonyms()

Stores a list of synonyms that should be replaced in $this->matchsynonym and $this->replacesynonym and caches them

from search_backend
int obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir)

Retrieves cached search results

from search_backend
save_ids($search_key, $keywords, $author_ary, $result_count, $id_ary, $start, $sort_dir)

Caches post/topic ids

from search_backend
destroy_cache($words, $authors = false)

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

from search_backend
fulltext_mysql($error)

init()

Checks for correct MySQL version and stores min/max word length in the config

bool split_keywords(string $keywords, string $terms)

Splits keywords entered by a user into an array of words stored in $this->splitwords Stores the tidied search query in $this->searchquery

split_message($text)

Turns text into an array of words

keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)

Performs a search on keywords depending on display specific params.

author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)

Performs a search on an author's posts without caring about message contents.

index($mode, $post_id, $message, $subject, $poster_id, $forum_id)

Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.

index_remove($post_ids, $author_ids, $forum_ids)

Destroy cached results, that might be outdated after deleting a post

tidy()

Destroy old cache entries

create_index($acp_module, $u_action)

Create fulltext index

delete_index($acp_module, $u_action)

Drop fulltext index

index_created()

Returns true if both FULLTEXT indexes exist

index_stats()

Returns an associative array containing information about the indexes

get_stats()

acp()

Display a note, that UTF-8 support is not available with certain versions of PHP

Details

in search_backend at line 38
public search_backend($error)

Parameters

$error

in search_backend at line 47
public get_ignore_words()

Retrieves a language dependend list of words that should be ignored by the search

in search_backend at line 69
public get_synonyms()

Stores a list of synonyms that should be replaced in $this->matchsynonym and $this->replacesynonym and caches them

in search_backend at line 98
public int obtain_ids($search_key, $result_count, $id_ary, $start, $per_page, $sort_dir)

Retrieves cached search results

Parameters

$search_key
$result_count
$id_ary
$start
$per_page
$sort_dir

Return Value

int SEARCHRESULTNOTINCACHE or SEARCHRESULTINCACHE or SEARCHRESULT_INCOMPLETE

in search_backend at line 158
public save_ids($search_key, $keywords, $author_ary, $result_count, $id_ary, $start, $sort_dir)

Caches post/topic ids

Parameters

$search_key
$keywords
$author_ary
$result_count
$id_ary
$start
$sort_dir

in search_backend at line 267
public 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

at line 39
public fulltext_mysql($error)

Parameters

$error

at line 66
public init()

Checks for correct MySQL version and stores min/max word length in the config

at line 126
public bool split_keywords(string $keywords, string $terms)

Splits keywords entered by a user into an array of words stored in $this->splitwords Stores the tidied search query in $this->searchquery

Parameters

string $keywords Contains the keyword as entered by the user
string $terms is either 'all' or 'any'

Return Value

bool false if no valid keywords were found and otherwise true

at line 275
public split_message($text)

Turns text into an array of words

Parameters

$text

Performs a search on keywords depending on display specific params.

You have to run split_keywords() first.

Parameters

$type
$fields
$terms
$sort_by_sql
$sort_key
$sort_dir
$sort_days
$ex_fid_ary
$m_approve_fid_ary
$topic_id
$author_ary
$author_name
$id_ary
$start
$per_page

Performs a search on an author's posts without caring about message contents.

Depends on display specific params

Parameters

$type
$firstpost_only
$sort_by_sql
$sort_key
$sort_dir
$sort_days
$ex_fid_ary
$m_approve_fid_ary
$topic_id
$author_ary
$author_name
$id_ary
$start
$per_page

at line 693
public index($mode, $post_id, $message, $subject, $poster_id, $forum_id)

Destroys cached search results, that contained one of the new words in a post so the results won't be outdated.

Parameters

$mode
$post_id
$message
$subject
$poster_id
$forum_id

at line 715
public index_remove($post_ids, $author_ids, $forum_ids)

Destroy cached results, that might be outdated after deleting a post

Parameters

$post_ids
$author_ids
$forum_ids

at line 723
public tidy()

Destroy old cache entries

at line 736
public create_index($acp_module, $u_action)

Create fulltext index

Parameters

$acp_module
$u_action

at line 797
public delete_index($acp_module, $u_action)

Drop fulltext index

Parameters

$acp_module
$u_action

at line 842
public index_created()

Returns true if both FULLTEXT indexes exist

at line 855
public index_stats()

Returns an associative array containing information about the indexes

at line 869
public get_stats()

at line 912
public acp()

Display a note, that UTF-8 support is not available with certain versions of PHP