Manipulates the search index.

Proxies to the search source handler.

package XenForo_Search

 Methods

Constructor.

__construct(\XenForo_Search_SourceHandler_Abstract $sourceHandler) 

Parameters

$sourceHandler

\XenForo_Search_SourceHandler_Abstractnull

Search source handler. Uses default if not specified.

Deletes the specified entry or entries from the index.

deleteFromIndex(string $contentType, array | integer $contentIds) 

Parameters

$contentType

string

Type of content to remove

$contentIds

arrayinteger

An array of content IDs or 1 as an integer. May be an array of data records as well.

When rebuilding, it might be advantageous to bulk update records.

finalizeRebuildSet() 

This function must be called to ensure that all records are updated together.

Inserts (or replaces) the specified record in the index.

insertIntoIndex(string $contentType, integer $contentId, string $title, string $message, integer $itemDate, integer $userId, integer $discussionId, array $metadata) 

Parameters

$contentType

string

Content type string

$contentId

integer

ID of the content being indexed

$title

string

Content title

$message

string

Content message

$itemDate

integer

Timestamp of content

$userId

integer

ID of user content belongs to

$discussionId

integer

ID of discussion or other grouping container

$metadata

array

Key value pairs of metadata to index.

Indexes the specified content.

quickIndex(string $contentType, array | integer $contentIds) : boolean

Parameters

$contentType

string

$contentIds

arrayinteger

One or more content IDs to index

Returns

boolean

Sets whether this is a bulk rebuild.

setIsRebuild(boolean $rebuild) 

If true, behavior may be modified to be less asynchronous.

Parameters

$rebuild

boolean

Updates the existing index record for a specified item.

updateIndex(string $contentType, integer $contentId, array $fieldUpdates) 

Parameters

$contentType

string

Content type string

$contentId

integer

ID of the content being indexed

$fieldUpdates

array

Key-value pairs of fields to update. Metadata is not updatable.

 Properties

 

$_sourceHandler

$_sourceHandler : \XenForo_Search_SourceHandler_Abstract