fulltext_postgres
class fulltext_postgres extends base
Fulltext search for PostgreSQL
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 string | $tsearch_query | Stores the tsearch query |
|
protected bool | $phrase_search | True if phrase search is supported. |
|
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 string | $search_query | Contains tidied search query. |
|
protected array | $common_words | Contains common words. |
|
protected array | $word_length | Associative array stores the min and max word length to be searched |
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_postgres, 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
Returns if phrase search is supported or not
Checks for correct PostgreSQL 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 various options that can be configured for the backend from the acp
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 103
__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_postgres, which is used as a search backend
at line 128
string
get_name()
Returns the name of this search backend to be displayed to administrators
at line 138
string
get_search_query()
Returns the search_query
at line 148
array
get_common_words()
Returns the common_words array
at line 158
array
get_word_length()
Returns the word_length array
at line 168
bool
supports_phrase_search()
Returns if phrase search is supported or not
at line 178
string|bool
init()
Checks for correct PostgreSQL version and stores min/max word length in the config
at line 196
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 287
split_message(string $text)
Turns text into an array of words
at line 329
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 609
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 885
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 933
index_remove($post_ids, $author_ids, $forum_ids)
Destroy cached results, that might be outdated after deleting a post
at line 941
tidy()
Destroy old cache entries
at line 954
string|bool
create_index($acp_module, $u_action)
Create fulltext index
at line 1015
string|bool
delete_index($acp_module, $u_action)
Drop fulltext index
at line 1074
index_created()
Returns true if both FULLTEXT indexes exist
at line 1087
index_stats()
Returns an associative array containing information about the indexes
at line 1102
protected
get_stats()
Computes the stats and store them in the $this->stats associative array
at line 1147
associative
acp()
Display various options that can be configured for the backend from the acp