fulltext_mysql
class fulltext_mysql extends base
Fulltext search for MySQL
Properties
$ignore_words | from base | ||
$match_synonym | from base | ||
$replace_synonym | from base | ||
protected array | $stats | Associative array holding index stats |
|
protected array | $split_words | Holds the words entered by user, obtained by splitting the entered query on whitespace |
|
protected config | $config | Config object |
|
protected driver_interface | $db | Database connection |
|
protected dispatcher_interface | $phpbb_dispatcher | phpBB event dispatcher object |
|
protected user | $user | User object |
|
protected array | $word_length | Associative array stores the min and max word length to be searched |
|
protected string | $search_query | Contains tidied search query. |
|
protected array | $common_words | Contains common words. |
Methods
Retrieves cached search results
Caches post/topic ids
Removes old entries from the search results table and removes searches with keywords that contain a word in $words.
Constructor Creates a new \phpbb\search\fulltext_mysql, which is used as a search backend
Returns the name of this search backend to be displayed to administrators
Returns the search_query
Returns the common_words array
Returns the word_length array
Checks for correct MySQL version and stores min/max word length in the config
Splits keywords entered by a user into an array of words stored in $this->split_words Stores the tidied search query in $this->search_query
Turns text into an array of words
Performs a search on keywords depending on display specific params. You have to run split_keywords() first
Performs a search on an author's posts without caring about message contents. Depends on display specific params
Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
Destroy cached results, that might be outdated after deleting a post
Destroy old cache entries
Create fulltext index
Drop fulltext index
Returns true if both FULLTEXT indexes exist
Returns an associative array containing information about the indexes
Computes the stats and store them in the $this->stats associative array
Display a note, that UTF-8 support is not available with certain versions of PHP
Details
in
base at line 33
search_backend($error)
No description
in
base 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
in
base at line 132
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
in
base at line 241
destroy_cache($words, $authors = false)
Removes old entries from the search results table and removes searches with keywords that contain a word in $words.
at line 90
__construct(string|bool $error, string $phpbb_root_path, string $phpEx, auth $auth, config $config, driver_interface $db, user $user, dispatcher_interface $phpbb_dispatcher)
Constructor Creates a new \phpbb\search\fulltext_mysql, which is used as a search backend
at line 115
string
get_name()
Returns the name of this search backend to be displayed to administrators
at line 125
string
get_search_query()
Returns the search_query
at line 135
array
get_common_words()
Returns the common_words array
at line 145
array
get_word_length()
Returns the word_length array
at line 155
string|bool
init()
Checks for correct MySQL version and stores min/max word length in the config
at line 224
bool
split_keywords(string $keywords, string $terms)
Splits keywords entered by a user into an array of words stored in $this->split_words Stores the tidied search query in $this->search_query
at line 363
split_message(string $text)
Turns text into an array of words
at line 405
bool|int
keyword_search(string $type, string $fields, string $terms, array $sort_by_sql, string $sort_key, string $sort_dir, string $sort_days, array $ex_fid_ary, string $post_visibility, int $topic_id, array $author_ary, string $author_name, array $id_ary, int $start, int $per_page)
Performs a search on keywords depending on display specific params. You have to run split_keywords() first
at line 668
bool|int
author_search(string $type, bool $firstpost_only, array $sort_by_sql, string $sort_key, string $sort_dir, string $sort_days, array $ex_fid_ary, string $post_visibility, int $topic_id, array $author_ary, string $author_name, array $id_ary, int $start, int $per_page)
Performs a search on an author's posts without caring about message contents. Depends on display specific params
at line 923
index(string $mode, int $post_id, string $message, string $subject, int $poster_id, int $forum_id)
Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
at line 971
index_remove($post_ids, $author_ids, $forum_ids)
Destroy cached results, that might be outdated after deleting a post
at line 979
tidy()
Destroy old cache entries
at line 992
string|bool
create_index($acp_module, $u_action)
Create fulltext index
at line 1066
string|bool
delete_index($acp_module, $u_action)
Drop fulltext index
at line 1132
index_created()
Returns true if both FULLTEXT indexes exist
at line 1145
index_stats()
Returns an associative array containing information about the indexes
at line 1160
protected
get_stats()
Computes the stats and store them in the $this->stats associative array
at line 1203
associative
acp()
Display a note, that UTF-8 support is not available with certain versions of PHP