PHP 클래스 phpbb\search\fulltext_sphinx

파일 보기 프로젝트 열기: phpbb/phpbb

보호된 프로퍼티들

프로퍼티 타입 설명
$auth phpbb\auth\auth Auth object
$config phpbb\config\config Config object
$config_file_data string Stores the generated content of the sphinx config file
$db phpbb\db\driver\driver_interface Database connection
$db_tools phpbb\db\tools\tools_interface Database Tools object
$dbtype string Stores the database type if supported by sphinx
$id string Holds unique sphinx id
$indexes string Stores the names of both main and delta sphinx indexes separated by a semicolon
$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
$sphinx SphinxClient Sphinx searchd client object
$split_words array Holds the words entered by user, obtained by splitting the entered query on whitespace
$stats array Associative array holding index stats
$user phpbb\user User object

공개 메소드들

메소드 설명
__construct ( string | boolean &$error, string $phpbb_root_path, string $phpEx, phpbb\auth\auth $auth, phpbb\config\config $config, $db, phpbb\user $user ) Constructor Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
acp ( ) : associative 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
create_index ( $acp_module, $u_action ) : string | boolean Create sphinx table
delete_index ( $acp_module, $u_action ) : string | boolean Drop sphinx table
get_common_words ( ) : array Returns an empty array as there are no common_words
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 ( ) : false Returns false as there is no word_len 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 ( $allow_new_files = true ) : boolean Returns true if the sphinx table was created
index_remove ( $post_ids, $author_ids, $forum_ids ) Delete a post from the index after it was deleted
index_stats ( ) : string | boolean Returns an associative array containing information about the indexes
init ( ) : string | boolean Checks permissions and paths, if everything is correct it generates the config file
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 ) : false 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
tidy ( $create = false ) Nothing needs to be destroyed

보호된 메소드들

메소드 설명
config_generate ( ) : boolean Generates content of sphinx.conf
get_stats ( ) Collects stats that can be displayed on the index maintenance page

메소드 상세

__construct() 공개 메소드

Constructor Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
public __construct ( string | boolean &$error, string $phpbb_root_path, string $phpEx, phpbb\auth\auth $auth, phpbb\config\config $config, $db, phpbb\user $user )
$error string | boolean Any error that occurs is passed on through this reference variable otherwise false
$phpbb_root_path string Relative path to phpBB root
$phpEx string PHP file extension
$auth phpbb\auth\auth Auth object
$config phpbb\config\config Config object
$user phpbb\user User object

acp() 공개 메소드

Returns a list of options for the ACP to display
public acp ( ) : associative
리턴 associative array containing template and config variables

config_generate() 보호된 메소드

Generates content of sphinx.conf
protected config_generate ( ) : boolean
리턴 boolean True if sphinx.conf content is correctly generated, false otherwise

create_index() 공개 메소드

Create sphinx table
public create_index ( $acp_module, $u_action ) : string | boolean
리턴 string | boolean error string is returned incase of errors otherwise false

delete_index() 공개 메소드

Drop sphinx table
public delete_index ( $acp_module, $u_action ) : string | boolean
리턴 string | boolean error string is returned incase of errors otherwise false

get_common_words() 공개 메소드

Returns an empty array as there are no common_words
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() 보호된 메소드

Collects stats that can be displayed on the index maintenance page
protected get_stats ( )

get_word_length() 공개 메소드

Returns false as there is no word_len array
public get_word_length ( ) : false
리턴 false

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 the sphinx table was created
public index_created ( $allow_new_files = true ) : boolean
리턴 boolean true if sphinx table was created

index_remove() 공개 메소드

Delete a post from the index after it was deleted
public index_remove ( $post_ids, $author_ids, $forum_ids )

index_stats() 공개 메소드

Returns an associative array containing information about the indexes
public index_stats ( ) : string | boolean
리턴 string | boolean Language string of error false otherwise

init() 공개 메소드

Checks permissions and paths, if everything is correct it generates the config file
public init ( ) : string | boolean
리턴 string | boolean Language key of the error/incompatiblity encountered, or false if successful

split_keywords() 공개 메소드

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
public split_keywords ( string &$keywords, string $terms ) : false
$keywords string Contains the keyword as entered by the user
$terms string is either 'all' or 'any'
리턴 false if no valid keywords were found and otherwise true

tidy() 공개 메소드

Nothing needs to be destroyed
public tidy ( $create = false )

프로퍼티 상세

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

Auth object
protected auth,phpbb\auth $auth
리턴 phpbb\auth\auth

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

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

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

Stores the generated content of the sphinx config file
protected string $config_file_data
리턴 string

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

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

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

Database Tools object
protected tools_interface,phpbb\db\tools $db_tools
리턴 phpbb\db\tools\tools_interface

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

Stores the database type if supported by sphinx
protected string $dbtype
리턴 string

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

Holds unique sphinx id
protected string $id
리턴 string

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

Stores the names of both main and delta sphinx indexes separated by a semicolon
protected string $indexes
리턴 string

$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

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

Sphinx searchd client object
protected SphinxClient $sphinx
리턴 SphinxClient

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

Holds the words entered by user, obtained by splitting the entered query on whitespace
protected array $split_words
리턴 array

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

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

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

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