Handles searching of threads.

package XenForo_Search

 Methods

Determines if this result is viewable.

canViewResult(array $result, array $viewingUser) : boolean

The user and combination ID will be the same as given to getDataForResults().

see \XenForo_Search_DataHandler_Abstract::canViewResult()

Parameters

$result

array

Data for a result

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

boolean

Creates the specified data handler.

create(string $class) : \XenForo_Search_DataHandler_Abstract
InheritedStatic
inherited_from \XenForo_Search_DataHandler_Abstract::create()

Parameters

$class

string

Object to create

Returns

Deletes one or more records from the index.

deleteFromIndex(\XenForo_Search_Indexer $indexer, array $dataList) 
Inherited

Wrapper around _deleteFromIndex().

inherited_from \XenForo_Search_DataHandler_Abstract::deleteFromIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$dataList

array

A list of data to remove. This may be one piece of data or multiple. Detection based on whether first element is an array.

Allow type-specific pre-constraint application filtering.

filterConstraints(\XenForo_Search_SourceHandler_Abstract $sourceHandler, array $constraints) : array
Inherited

For example, a "thread only" constraint may change the searchable content types.

inherited_from \XenForo_Search_DataHandler_Abstract::filterConstraints()

Parameters

$sourceHandler

\XenForo_Search_SourceHandler_Abstract

Source handler calling

$constraints

array

Unfiltered constraints

Returns

arrayFiltered constraints

Gets the type-specific data for a collection of results of this content type.

getDataForResults(array $ids, array $viewingUser, array $resultsGrouped) : array

If any of the given IDs are not returned from this, they will be removed from the results.

see \XenForo_Search_DataHandler_Abstract::getDataForResults()

Parameters

$ids

array

List of IDs of this content type.

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

$resultsGrouped

array

List of all results grouped by content type

Returns

arrayFormat: [id] => data, IDs not returned will be removed from results

Gets the content type that will be returned when grouping results.

getGroupByType() : string
Inherited
inherited_from \XenForo_Search_DataHandler_Abstract::getGroupByType()

Returns

stringIf empty, grouping will not be possible

Get the data that is needed to do joins/queries against data that isn't kept in the search index itself.

getJoinStructures(array $tables) : array
Inherited
inherited_from \XenForo_Search_DataHandler_Abstract::getJoinStructures()

Parameters

$tables

array

List of table aliases (in the keys) that are requested for this search

Returns

arrayKeys should be table aliases (to use in query). Values are arrays with keys: * table - actual table name * key - name of the field in the table that matches up with the relationship field * relationship - field to join against. Array, 0 = table of field, 1 = field name.

Gets the search order for a type-specific search.

getOrderClause(string $order) : false | array
Inherited
inherited_from \XenForo_Search_DataHandler_Abstract::getOrderClause()

Parameters

$order

string

Order requested by user

Returns

falsearrayFalse or or array of arrays. Child array keys: 0 = table alias, 1 = field, 2 = dir (asc/desc)

Gets the date of the result (from the result's content).

getResultDate(array $result) : integer
see \XenForo_Search_DataHandler_Abstract::getResultDate()

Parameters

$result

array

Returns

integer

Get the content types that will be searched, when doing a type-specific search for this type.

getSearchContentTypes() : array

This may be multiple types (for example, thread and post for post searches).

Returns

array

Get the controller response for the form to search this type of content specifically.

getSearchFormControllerResponse(\XenForo_ControllerPublic_Abstract $controller, \XenForo_Input $input, array $viewParams) : \XenForo_ControllerResponse_Abstract | false
Inherited
inherited_from \XenForo_Search_DataHandler_Abstract::getSearchFormControllerResponse()

Parameters

$controller

\XenForo_ControllerPublic_Abstract

Invoking controller

$input

\XenForo_Input

Input object from controller

$viewParams

array

View params prepared for general search

Returns

Get type-specific constrints from input.

getTypeConstraintsFromInput(\XenForo_Input $input) : array
Inherited
inherited_from \XenForo_Search_DataHandler_Abstract::getTypeConstraintsFromInput()

Parameters

Returns

array

Inserts a new record or replaces an existing record in the index.

insertIntoIndex(\XenForo_Search_Indexer $indexer, array $data, array $parentData) 
Inherited

Wrapper around _insertIntoIndex().

inherited_from \XenForo_Search_DataHandler_Abstract::insertIntoIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$data

array

Data that needs to be updated

$parentData

arraynull

Data about the parent info (eg, for a post, the parent thread)

Prepares a result for display.

prepareResult(array $result, array $viewingUser) : array
see \XenForo_Search_DataHandler_Abstract::prepareResult()

Parameters

$result

array

$viewingUser

array

Information about the viewing user (keys: user_id, permission_combination_id, permissions)

Returns

arrayPrepared result

Process a constraint, if it is known to be specific to this type.

processConstraint(\XenForo_Search_SourceHandler_Abstract $sourceHandler, string $constraint, mixed $constraintInfo, array $constraints) : array | false
Inherited

If the constraint is unknown, it should simply be ignored.

inherited_from \XenForo_Search_DataHandler_Abstract::processConstraint()

Parameters

$sourceHandler

\XenForo_Search_SourceHandler_Abstract

Source handler invoking

$constraint

string

Name of the constraint

$constraintInfo

mixed

Data for the constraint; may be an array or scalar

$constraints

array

List of all constraints specified

Returns

arrayfalseIf processed, return array with possible keys: * metadata - metadata value; keys: 0 = name of metadata, 1 = scalar/array allowed value(s) for metadata * query - constraint to limit via query; keys: 0 = table alias, 1 = field, 2 = operator, 3 = scalar/array allowed value(s). Multiple for "=" operator only. Note that the metadata and query keys are assumed to be equivalent. Engines need only use one (depending on engine details).

Rebuilds the index for the specified content.

quickIndex(\XenForo_Search_Indexer $indexer, array $contentIds) : array
see \XenForo_Search_DataHandler_Abstract::quickIndex()

Parameters

$contentIds

array

Returns

arrayList of content IDs indexed

Rebuilds the index for a batch.

rebuildIndex(\XenForo_Search_Indexer $indexer, integer $lastId, integer $batchSize) : integer | false
see \XenForo_Search_DataHandler_Abstract::rebuildIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$lastId

integer

The last ID that was processed. Should continue with the IDs above this.

$batchSize

integer

Number of records to process at once

Returns

integerfalseThe last ID that was processed or false if none were processed

Renders a result to HTML.

renderResult(\XenForo_View $view, array $result, array $search) : \XenForo_Template_Abstract | string
see \XenForo_Search_DataHandler_Abstract::renderResult()

Parameters

$result

array

Data from result

$search

array

The search that was performed

Returns

Updates a record in the index.

updateIndex(\XenForo_Search_Indexer $indexer, array $data, array $fieldUpdates) 
Inherited

Wrapper around _updateIndex().

inherited_from \XenForo_Search_DataHandler_Abstract::updateIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$data

array

Data that needs to be updated

$fieldUpdates

array

Key-value fields to update

Deletes one or more records from the index.

_deleteFromIndex(\XenForo_Search_Indexer $indexer, array $dataList) 

Wrapper around _deleteFromIndex().

see \XenForo_Search_DataHandler_Abstract::_deleteFromIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$dataList

array

A list of data to remove. Each element is an array of the data from one record or an ID.

_getThreadModel()

_getThreadModel() : \XenForo_Model_Thread

Inserts into (or replaces a record) in the index.

_insertIntoIndex(\XenForo_Search_Indexer $indexer, array $data, array $parentData) 
see \XenForo_Search_DataHandler_Abstract::_insertIntoIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$data

array

Data that needs to be updated

$parentData

arraynull

Data about the parent info (eg, for a post, the parent thread)

Updates a record in the index.

_updateIndex(\XenForo_Search_Indexer $indexer, array $data, array $fieldUpdates) 
see \XenForo_Search_DataHandler_Abstract::_updateIndex()

Parameters

$indexer

\XenForo_Search_Indexer

Object that will will manipulate the index

$data

array

Data that needs to be updated

$fieldUpdates

array

Key-value fields to update

 Properties

 

$_threadModel : \XenForo_Model_Thread