class fulltext_native extends base
phpBB's own db driven fulltext search, version 2
Constants
UTF8_HANGUL_FIRST |
|
UTF8_HANGUL_LAST |
|
UTF8_CJK_FIRST |
|
UTF8_CJK_LAST |
|
UTF8_CJK_B_FIRST |
|
UTF8_CJK_B_LAST |
|
Properties
$ignore_words | ||
$match_synonym | ||
$replace_synonym |
Methods
search_backend($error)
|
from base | |
int |
obtain_ids(string $search_key, int $result_count, array $id_ary, int $start, int $per_page, string $sort_dir)
Retrieves cached search results |
from base |
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 |
from base |
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 base | |
__construct($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
Initialises the fulltext_native search backend with min/max word length |
||
string |
get_name()
Returns the name of this search backend to be displayed to administrators |
|
string |
get_search_query()
Returns the search_query |
|
array |
get_common_words()
Returns the common_words array |
|
array |
get_word_length()
Returns the word_length array |
|
split_keywords($keywords, $terms)
This function fills $this->search_query with the cleaned user search query |
||
keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $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, $post_visibility, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)
Performs a search on an author's posts without caring about message contents. |
||
split_message($text)
Split a text into words of a given length |
||
index($mode, $post_id, $message, $subject, $poster_id, $forum_id)
Updates wordlist and wordmatch tables when a message is posted or changed |
||
index_remove($post_ids, $author_ids, $forum_ids)
Removes entries from the wordmatch table for the specified post_ids |
||
tidy()
Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table |
||
delete_index($acp_module, $u_action)
Deletes all words from the index |
||
index_created()
Returns true if both FULLTEXT indexes exist |
||
index_stats()
Returns an associative array containing information about the indexes |
||
acp()
Returns a list of options for the ACP to display |
Details
in base at line 33
public
search_backend($error)
in base at line 51
public 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
public 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
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.
at line 114
public
__construct($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher)
Initialises the fulltext_native search backend with min/max word length
at line 141
public string
get_name()
Returns the name of this search backend to be displayed to administrators
at line 151
public string
get_search_query()
Returns the search_query
at line 161
public array
get_common_words()
Returns the common_words array
at line 171
public array
get_word_length()
Returns the word_length array
at line 191
public
split_keywords($keywords, $terms)
This function fills $this->search_query with the cleaned user search query
If $terms is 'any' then the words will be extracted from the search query and combined with | inside brackets. They will afterwards be treated like an standard search query.
Then it analyses the query and fills the internal arrays $mustnotcontainids, $mustcontainids and $mustexcludeoneids which are later used by keyword_search()
at line 530
public
keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)
Performs a search on keywords depending on display specific params.
You have to run split_keywords() first
at line 1030
public
author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $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
at line 1333
public
split_message($text)
Split a text into words of a given length
The text is converted to UTF-8, cleaned up, and split. Then, words that conform to the defined length range are returned in an array.
NOTE: duplicates are NOT removed from the return array
at line 1407
public
index($mode, $post_id, $message, $subject, $poster_id, $forum_id)
Updates wordlist and wordmatch tables when a message is posted or changed
at line 1596
public
index_remove($post_ids, $author_ids, $forum_ids)
Removes entries from the wordmatch table for the specified post_ids
at line 1654
public
tidy()
Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table
at line 1717
public
delete_index($acp_module, $u_action)
Deletes all words from the index
at line 1761
public
index_created()
Returns true if both FULLTEXT indexes exist
at line 1774
public
index_stats()
Returns an associative array containing information about the indexes
at line 2031
public
acp()
Returns a list of options for the ACP to display