search_backend_interface
interface search_backend_interface
Methods
Returns the name of this search backend to be displayed to administrators
Returns if the search engine is available
Method executed when a search backend is set from acp.
Returns the search_query
Returns the common_words array
Returns the word_length array
Splits keywords entered by a user into an array of words stored in $this->split_words This function fills $this->search_query with the cleaned user search query
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
Returns if phrase search is supported or not
Updates wordlist and wordmatch tables when a message is posted or changed 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
Display various options that can be configured for the backend from the acp
Gets backend class
Details
at line 23
string
get_name()
Returns the name of this search backend to be displayed to administrators
at line 30
bool
is_available()
Returns if the search engine is available
at line 39
string|false
init()
Method executed when a search backend is set from acp.
Checks permissions and paths, if everything is correct it generates the config file
at line 46
string
get_search_query()
Returns the search_query
at line 53
array
get_common_words()
Returns the common_words array
at line 60
array|false
get_word_length()
Returns the word_length array
at line 78
bool
split_keywords(string $keywords, string $terms)
Splits keywords entered by a user into an array of words stored in $this->split_words 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 $must_not_contain_ids, $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search()
at line 100
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 121
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 128
bool
supports_phrase_search()
Returns if phrase search is supported or not
at line 141
index(string $mode, int $post_id, string $message, string $subject, int $poster_id, int $forum_id)
Updates wordlist and wordmatch tables when a message is posted or changed Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
at line 151
void
index_remove(array $post_ids, array $author_ids, array $forum_ids)
Destroy cached results, that might be outdated after deleting a post
at line 158
void
tidy()
Destroy old cache entries
at line 166
array|null
create_index(int $post_counter = 0)
Create fulltext index
at line 174
array|null
delete_index(int $post_counter = 0)
Drop fulltext index
at line 181
bool
index_created()
Returns true if both FULLTEXT indexes exist
at line 188
array|false
index_stats()
Returns an associative array containing information about the indexes
at line 195
array
get_acp_options()
Display various options that can be configured for the backend from the acp
at line 202
string
get_type()
Gets backend class