search_backend
└─fulltext_native
public class fulltext_native
extends search_backend
| Field Summary | |
|---|---|
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| mixed | |
| Fields inherited from search\search_backend | |
|---|---|
| ignore_words, match_synonym, replace_synonym | |
| Method Summary | |
|---|---|
| void | __construct(mixed error, boolean|string &$error) Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded. |
| static void | acp() Returns a list of options for the ACP to display |
| boolean|int | author_search(string type, boolean firstpost_only, array sort_by_sql, string sort_key, string sort_dir, string sort_days, array ex_fid_ary, array m_approve_fid_ary, int topic_id, array author_ary, string author_name, mixed id_ary, int start, int per_page, array &$id_ary) Performs a search on an author's posts without caring about message contents. |
| string | cleanup(string text, string allowed_chars, string encoding) Clean up a text to remove non-alphanumeric charactersThis method receives a UTF-8 string, normalizes and validates it, replaces all non-alphanumeric characters with strings then returns the result. |
| void | delete_index(mixed acp_module, mixed u_action) Deletes all words from the index |
| void | |
| void | index(string mode, int post_id, mixed message, mixed subject, int poster_id, int forum_id, string &$message, string &$subject) Updates wordlist and wordmatch tables when a message is posted or changed |
| void | Returns true if both FULLTEXT indexes exist |
| void | index_remove(mixed post_ids, mixed author_ids, mixed forum_ids) Removes entries from the wordmatch table for the specified post_ids |
| void | Returns an associative array containing information about the indexes |
| boolean|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, array m_approve_fid_ary, int topic_id, array author_ary, string author_name, mixed id_ary, int start, int per_page, array &$id_ary) Performs a search on keywords depending on display specific params. |
| boolean | split_keywords(string keywords, string terms) This function fills $this->search_query with the cleaned user search query. |
| void | tidy() Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table |
| Methods inherited from search\search_backend | |
|---|---|
| __construct, destroy_cache, get_ignore_words, get_synonyms, obtain_ids, save_ids | |
public mixed $common_words = array()
public mixed $must_contain_ids = array()
public mixed $must_exclude_one_ids = array()
public mixed $must_not_contain_ids = array()
public mixed $search_query
public mixed $stats = array()
public mixed $word_length = array()
public void __construct(mixed error, boolean|string &$error)
Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded.
public static void acp()
Returns a list of options for the ACP to display
public boolean|int author_search(string type, boolean firstpost_only, array sort_by_sql, string sort_key, string sort_dir, string sort_days, array ex_fid_ary, array m_approve_fid_ary, int topic_id, array author_ary, string author_name, mixed id_ary, int start, int per_page, array &$id_ary)
Performs a search on an author's posts without caring about message contents. Depends on display specific params
public string cleanup(string text, string allowed_chars, string encoding)
Clean up a text to remove non-alphanumeric characters
This method receives a UTF-8 string, normalizes and validates it, replaces all non-alphanumeric characters with strings then returns the result.
Any number of "allowed chars" can be passed as a UTF-8 string in NFC.
public void delete_index(mixed acp_module, mixed u_action)
Deletes all words from the index
public void get_stats()
public void index(string mode, int post_id, mixed message, mixed subject, int poster_id, int forum_id, string &$message, string &$subject)
Updates wordlist and wordmatch tables when a message is posted or changed
public void index_created()
Returns true if both FULLTEXT indexes exist
public void index_remove(mixed post_ids, mixed author_ids, mixed forum_ids)
Removes entries from the wordmatch table for the specified post_ids
public void index_stats()
Returns an associative array containing information about the indexes
public boolean|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, array m_approve_fid_ary, int topic_id, array author_ary, string author_name, mixed id_ary, int start, int per_page, array &$id_ary)
Performs a search on keywords depending on display specific params. You have to run split_keywords() first.
public boolean split_keywords(string keywords, string 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 $must_not_contain_ids, $must_contain_ids and $must_exclude_one_ids which are later used by keyword_search().
public void tidy()
Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table
fulltext_native phpBB's own db driven fulltext search, version 2