phpBB API Documentation
Class

phpbb\search\fulltext_sphinx

class fulltext_sphinx

Fulltext search based on the sphinx search deamon

Methods

__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

string get_name()

Returns the name of this search backend to be displayed to administrators

string get_search_query()

Returns the search_query

false get_word_length()

Returns false as there is no word_len array

array get_common_words()

Returns an empty array as there are no common_words

string|bool init()

Checks permissions and paths, if everything is correct it generates the config file

false split_keywords(string $keywords, string $terms)

Splits keywords entered by a user into an array of words stored in $this->splitwords Stores the tidied search query in $this->searchquery

keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)

Performs a search on keywords depending on display specific params.

author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, $id_ary, $start, $per_page)

Performs a search on an author's posts without caring about message contents.

index($mode, $post_id, $message, $subject, $poster_id, $forum_id)

Updates wordlist and wordmatch tables when a message is posted or changed

index_remove($post_ids, $author_ids, $forum_ids)

Delete a post from the index after it was deleted

tidy($create = false)

Nothing needs to be destroyed

string|bool create_index($acp_module, $u_action)

Create sphinx table

string|bool delete_index($acp_module, $u_action)

Drop sphinx table

bool index_created($allow_new_files = true)

Returns true if the sphinx table was created

string|bool index_stats()

Returns an associative array containing information about the indexes

associative acp()

Returns a list of options for the ACP to display

Details

at line 136
public __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

Parameters

string|bool $error Any error that occurs is passed on through this reference variable otherwise false
string $phpbb_root_path Relative path to phpBB root
string $phpEx PHP file extension
auth $auth Auth object
config $config Config object
driver_interface $db Database object
user $user User object
dispatcher_interface $phpbb_dispatcher Event dispatcher object

at line 175
public string get_name()

Returns the name of this search backend to be displayed to administrators

Return Value

string Name

at line 185
public string get_search_query()

Returns the search_query

Return Value

string search query

at line 195
public false get_word_length()

Returns false as there is no word_len array

Return Value

false

at line 205
public array get_common_words()

Returns an empty array as there are no common_words

Return Value

array common words that are ignored by search backend

at line 215
public string|bool init()

Checks permissions and paths, if everything is correct it generates the config file

Return Value

string|bool Language key of the error/incompatiblity encountered, or false if successful

at line 434
public false split_keywords(string $keywords, string $terms)

Splits keywords entered by a user into an array of words stored in $this->splitwords Stores the tidied search query in $this->searchquery

Parameters

string $keywords Contains the keyword as entered by the user
string $terms is either 'all' or 'any'

Return Value

false if no valid keywords were found and otherwise true

Performs a search on keywords depending on display specific params.

You have to run split_keywords() first

Parameters

$type
$fields
$terms
$sort_by_sql
$sort_key
$sort_dir
$sort_days
$ex_fid_ary
$post_visibility
$topic_id
$author_ary
$author_name
$id_ary
$start
$per_page

Performs a search on an author's posts without caring about message contents.

Depends on display specific params

Parameters

$type
$firstpost_only
$sort_by_sql
$sort_key
$sort_dir
$sort_days
$ex_fid_ary
$post_visibility
$topic_id
$author_ary
$author_name
$id_ary
$start
$per_page

at line 759
public index($mode, $post_id, $message, $subject, $poster_id, $forum_id)

Updates wordlist and wordmatch tables when a message is posted or changed

Parameters

$mode
$post_id
$message
$subject
$poster_id
$forum_id

at line 803
public index_remove($post_ids, $author_ids, $forum_ids)

Delete a post from the index after it was deleted

Parameters

$post_ids
$author_ids
$forum_ids

at line 817
public tidy($create = false)

Nothing needs to be destroyed

Parameters

$create

at line 827
public string|bool create_index($acp_module, $u_action)

Create sphinx table

Parameters

$acp_module
$u_action

Return Value

string|bool error string is returned incase of errors otherwise false

at line 859
public string|bool delete_index($acp_module, $u_action)

Drop sphinx table

Parameters

$acp_module
$u_action

Return Value

string|bool error string is returned incase of errors otherwise false

at line 876
public bool index_created($allow_new_files = true)

Returns true if the sphinx table was created

Parameters

$allow_new_files

Return Value

bool true if sphinx table was created

at line 893
public string|bool index_stats()

Returns an associative array containing information about the indexes

Return Value

string|bool Language string of error false otherwise

at line 935
public associative acp()

Returns a list of options for the ACP to display

Return Value

associative array containing template and config variables