vB_Library_Search
extends vB_Library
in package
vB_Library_Search
Table of Contents
- $instance : mixed
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- attributeChanged() : mixed
- clean() : mixed
- clearCache() : mixed
- convertToParentChannels() : mixed
- delete() : mixed
- emptyIndex() : mixed
- getContentInstance() : mixed
- getRangeFromNodeCount() : int
- Gets the nodes to index from a particular node
- index() : mixed
- Index a node
- indexNodeList() : mixed
- indexRangeFromNode() : int|bool
- Index a range of nodes based on the prior node
- indexText() : mixed
- indexTrending() : mixed
- instance() : vB_PageCache
- Returns singleton instance of self.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- purgeCacheForCurrentUser() : mixed
- Purge search log cache for current logged-in user
- reIndexAll() : bool
- Re-indexes the whole database Returns true if the full indexing is implemented and successful for the selected search implementation Returns false if the full indexing is not implemented
- __construct() : mixed
- getLibraryClassNameInternal() : mixed
- doIndexNodeList() : mixed
- getNodeRangeConditions() : mixed
Properties
$instance
protected
static mixed
$instance
= array()
Methods
__serialize()
public
__serialize() : mixed
Return values
mixed —__sleep()
public
__sleep() : mixed
Return values
mixed —__unserialize()
public
__unserialize(mixed $serialized) : mixed
Parameters
- $serialized : mixed
Return values
mixed —__wakeup()
public
__wakeup() : mixed
Return values
mixed —attributeChanged()
public
attributeChanged(mixed $nodeid) : mixed
Parameters
- $nodeid : mixed
Return values
mixed —clean()
public
clean() : mixed
Return values
mixed —clearCache()
public
static clearCache() : mixed
Return values
mixed —convertToParentChannels()
public
convertToParentChannels(mixed $filterType, mixed $filterChannels, mixed $includeChildren) : mixed
Parameters
- $filterType : mixed
- $filterChannels : mixed
- $includeChildren : mixed
Return values
mixed —delete()
public
delete(mixed $nodeid[, mixed $node = false ]) : mixed
Parameters
- $nodeid : mixed
- $node : mixed = false
Return values
mixed —emptyIndex()
public
emptyIndex() : mixed
Return values
mixed —getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
Return values
mixed —getRangeFromNodeCount()
Gets the nodes to index from a particular node
public
getRangeFromNodeCount(int $previousNodeId[, mixed $channelid = null ][, mixed $contenttype = null ]) : int
The companion of indexRangeFromNode, this get's the total number of nodes to count. The startNode is provided in case a partial index is intended. The expectation is that this is called once with the starting node and not for each batch. This will take some time on larger sites so should be avoided if time is an issue (it may cause the webserver to time out).
This is primarily hear to avoid duplicating logic affecting the count that might change.
Parameters
- $previousNodeId : int
-
-- the node to start after. This is frequently the nodeid returned from the previous batch. Pass 0 to start from the beginning. Pass $nodid-1 to start at a particular node inclusive.
- $channelid : mixed = null
- $contenttype : mixed = null
Return values
int —-- the number of nodes to index
index()
Index a node
public
index(int $node_id[, bool $propagate = true ]) : mixed
Parameters
- $node_id : int
-
to index
- $propagate : bool = true
-
flag to propagate the indexing to the nodes parents
Return values
mixed —indexNodeList()
public
indexNodeList(mixed $nodeids) : mixed
Parameters
- $nodeids : mixed
Return values
mixed —indexRangeFromNode()
Index a range of nodes based on the prior node
public
indexRangeFromNode(int $previousNodeId, int $perpage[, mixed $channelid = null ][, mixed $contenttype = null ]) : int|bool
This is intended to page through a list of nodes to break up a reindex operation without using a (limitstart, limit) process that doesn't scale well to large node tables.
We skip channels and reports when doing the range.
Parameters
- $previousNodeId : int
-
-- the node to start after. This is frequently the nodeid returned from the previous batch. Pass 0 to start from the beginning. Pass $nodid-1 to start at a particular node inclusive.
- $perpage : int
-
-- the number of nodes to index per run. You can pass a false value to index the entire table in one go, but this isn't really a good idea on large sites.
- $channelid : mixed = null
- $contenttype : mixed = null
Return values
int|bool —-- returns the id of the last node indexed or false if there are no more nodes to index.
indexText()
public
indexText(mixed $node, mixed $title, mixed $text) : mixed
Parameters
- $node : mixed
- $title : mixed
- $text : mixed
Return values
mixed —indexTrending()
public
indexTrending(mixed $lookback, mixed $minimum) : mixed
Parameters
- $lookback : mixed
- $minimum : mixed
Return values
mixed —instance()
Returns singleton instance of self.
public
static instance(mixed $class) : vB_PageCache
Parameters
- $class : mixed
Return values
vB_PageCache —- Reference to singleton instance of the cache handler
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ], mixed $currentuserid) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed
Return values
mixed —purgeCacheForCurrentUser()
Purge search log cache for current logged-in user
public
purgeCacheForCurrentUser([mixed $from = false ]) : mixed
Parameters
- $from : mixed = false
Return values
mixed —reIndexAll()
Re-indexes the whole database Returns true if the full indexing is implemented and successful for the selected search implementation Returns false if the full indexing is not implemented
public
reIndexAll([mixed $silent = false ]) : bool
Parameters
- $silent : mixed = false
Return values
bool —__construct()
protected
__construct() : mixed
Return values
mixed —getLibraryClassNameInternal()
protected
static getLibraryClassNameInternal(mixed $controller) : mixed
Parameters
- $controller : mixed
Return values
mixed —doIndexNodeList()
private
doIndexNodeList(mixed $nodes, mixed $perpage) : mixed
Parameters
- $nodes : mixed
- $perpage : mixed
Return values
mixed —getNodeRangeConditions()
private
getNodeRangeConditions(mixed $previousNodeId, mixed $channelid, mixed $contenttype) : mixed
Parameters
- $previousNodeId : mixed
- $channelid : mixed
- $contenttype : mixed