PHP 클래스 phpbb\search\fulltext_native

상속: extends phpbb\search\base
파일 보기 프로젝트 열기: phpbb/phpbb

보호된 프로퍼티들

프로퍼티 타입 설명
$common_words array Common words are words with length less/more than min/max length
$config phpbb\config\config Config object
$db phpbb\db\driver\driver_interface Database connection
$must_contain_ids array Post ids of posts containing words that are to be included
$must_exclude_one_ids array Post ids of posts containing atleast one word that needs to be excluded
$must_not_contain_ids array Post ids of posts containing words that should not be included
$php_ext string PHP Extension
$phpbb_root_path string Relative path to board root
$search_query string Operators are prefixed in search query and common words excluded
$stats array Associative array holding index stats
$user phpbb\user User object
$word_length array Associative array stores the min and max word length to be searched

공개 메소드들

메소드 설명
__construct ( &$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user ) Initialises the fulltext_native search backend with min/max word length
acp ( ) Returns a list of options for the ACP to display
author_search ( string $type, boolean $firstpost_only, array $sort_by_sql, string $sort_key, string $sort_dir, string $sort_days, array $ex_fid_ary, string $post_visibility, integer $topic_id, array $author_ary, string $author_name, &$id_ary, integer &$start, integer $per_page ) : boolean | integer Performs a search on an author's posts without caring about message contents. Depends on display specific params
delete_index ( $acp_module, $u_action ) Deletes all words from the index
get_common_words ( ) : array Returns the common_words array
get_name ( ) : string Returns the name of this search backend to be displayed to administrators
get_search_query ( ) : string Returns the search_query
get_word_length ( ) : array Returns the word_length array
index ( string $mode, integer $post_id, &$message, &$subject, integer $poster_id, integer $forum_id ) Updates wordlist and wordmatch tables when a message is posted or changed
index_created ( ) Returns true if both FULLTEXT indexes exist
index_remove ( $post_ids, $author_ids, $forum_ids ) Removes entries from the wordmatch table for the specified post_ids
index_stats ( ) Returns an associative array containing information about the indexes
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, integer $topic_id, array $author_ary, string $author_name, &$id_ary, integer &$start, integer $per_page ) : boolean | integer Performs a search on keywords depending on display specific params. You have to run split_keywords() first
split_keywords ( string $keywords, string $terms ) : boolean This function fills $this->search_query with the cleaned user search query
split_message ( string $text ) : array Split a text into words of a given length
tidy ( ) Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table

보호된 메소드들

메소드 설명
cleanup ( string $text, string $allowed_chars = null, string $encoding = 'utf-8' ) : string Clean up a text to remove non-alphanumeric characters
get_stats ( )

메소드 상세

__construct() 공개 메소드

Initialises the fulltext_native search backend with min/max word length
public __construct ( &$error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user )

acp() 공개 메소드

Returns a list of options for the ACP to display
public acp ( )

cleanup() 보호된 메소드

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.
protected cleanup ( string $text, string $allowed_chars = null, string $encoding = 'utf-8' ) : string
$text string Text to split, in UTF-8 (not normalized or sanitized)
$allowed_chars string String of special chars to allow
$encoding string Text encoding
리턴 string Cleaned up text, only alphanumeric chars are left

delete_index() 공개 메소드

Deletes all words from the index
public delete_index ( $acp_module, $u_action )

get_common_words() 공개 메소드

Returns the common_words array
public get_common_words ( ) : array
리턴 array common words that are ignored by search backend

get_name() 공개 메소드

Returns the name of this search backend to be displayed to administrators
public get_name ( ) : string
리턴 string Name

get_search_query() 공개 메소드

Returns the search_query
public get_search_query ( ) : string
리턴 string search query

get_stats() 보호된 메소드

protected get_stats ( )

get_word_length() 공개 메소드

Returns the word_length array
public get_word_length ( ) : array
리턴 array min and max word length for searching

index() 공개 메소드

Updates wordlist and wordmatch tables when a message is posted or changed
public index ( string $mode, integer $post_id, &$message, &$subject, integer $poster_id, integer $forum_id )
$mode string Contains the post mode: edit, post, reply, quote
$post_id integer The id of the post which is modified/created
$poster_id integer Post author's user id
$forum_id integer The id of the forum in which the post is located

index_created() 공개 메소드

Returns true if both FULLTEXT indexes exist
public index_created ( )

index_remove() 공개 메소드

Removes entries from the wordmatch table for the specified post_ids
public index_remove ( $post_ids, $author_ids, $forum_ids )

index_stats() 공개 메소드

Returns an associative array containing information about the indexes
public index_stats ( )

split_keywords() 공개 메소드

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 split_keywords ( string $keywords, string $terms ) : boolean
$keywords string contains the search query string as entered by the user
$terms string is either 'all' (use search query as entered, default words to 'must be contained in post') or 'any' (find all posts containing at least one of the given words)
리턴 boolean false if no valid keywords were found and otherwise true

split_message() 공개 메소드

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
public split_message ( string $text ) : array
$text string Text to split, encoded in UTF-8
리턴 array Array of UTF-8 words

tidy() 공개 메소드

Tidy up indexes: Tag 'common words' and remove words no longer referenced in the match table
public tidy ( )

프로퍼티 상세

$common_words 보호되어 있는 프로퍼티

Common words are words with length less/more than min/max length
protected array $common_words
리턴 array

$config 보호되어 있는 프로퍼티

Config object
protected config,phpbb\config $config
리턴 phpbb\config\config

$db 보호되어 있는 프로퍼티

Database connection
protected driver_interface,phpbb\db\driver $db
리턴 phpbb\db\driver\driver_interface

$must_contain_ids 보호되어 있는 프로퍼티

Post ids of posts containing words that are to be included
protected array $must_contain_ids
리턴 array

$must_exclude_one_ids 보호되어 있는 프로퍼티

Post ids of posts containing atleast one word that needs to be excluded
protected array $must_exclude_one_ids
리턴 array

$must_not_contain_ids 보호되어 있는 프로퍼티

Post ids of posts containing words that should not be included
protected array $must_not_contain_ids
리턴 array

$php_ext 보호되어 있는 프로퍼티

PHP Extension
protected string $php_ext
리턴 string

$phpbb_root_path 보호되어 있는 프로퍼티

Relative path to board root
protected string $phpbb_root_path
리턴 string

$search_query 보호되어 있는 프로퍼티

Operators are prefixed in search query and common words excluded
protected string $search_query
리턴 string

$stats 보호되어 있는 프로퍼티

Associative array holding index stats
protected array $stats
리턴 array

$user 보호되어 있는 프로퍼티

User object
protected user,phpbb $user
리턴 phpbb\user

$word_length 보호되어 있는 프로퍼티

Associative array stores the min and max word length to be searched
protected array $word_length
리턴 array