__construct()
deleteFromIndex()
error()
executeSearch()
executeSearchByUserId()
finalizeRebuildSet()
getDefaultSourceHandler()
getGeneralOrderClause()
getMetadataKey()
insertIntoIndex()
parseTokenizedQuery()
processConstraints()
searchGeneral()
searchType()
setIsRebuild()
setSearcher()
splitWords()
supportsRelevance()
tokenizeQuery()
updateIndex()
warning()
_getDb()
_pushToIndex()
$stopWords
$_bulkInsertLength
$_bulkInserts
$_db
$_isRebuild
$_minWordLength
$_searcher
SPLIT_CHAR_RANGES
Handler for searching with MySQL's full text search.
package | XenForo_Search |
---|
__construct()
deleteFromIndex(string $contentType, array $contentIds)
see | \global\XenForo_Search_SourceHandler_Abstract::deleteFromIndex() |
---|
string
array
List of content IDs (of $contentType to delete)
error(\XenForo_Phrase | string $message, string $field)
An error will prevent the search from going through.
inherited_from | \XenForo_Search_SourceHandler_Abstract::error() |
---|
string
Field error applies to
executeSearch(string $searchQuery, boolean $titleOnly, array $processedConstraints, array $orderParts, string $groupByDiscussionType, integer $maxResults, \XenForo_Search_DataHandler_Abstract $typeHandler) : array
string
Text to search for
boolean
If true, only searches text in titles
array
Structured constraints
array
Structured ordered by parts
string
If grouping, content type of grouped results
integer
array
Search results ([] => array(content type, id))executeSearchByUserId(integer $userId, integer $maxDate, integer $maxResults) : array
Currently this includes no constraints, but down the line it may support non-query constraints.
see | \global\XenForo_Search_SourceHandler_Abstract::executeSearchByUserId() |
---|
integer
integer
If >0, only messages older than this should be found
integer
array
Search results ([] => array(content type, id))finalizeRebuildSet()
This function must be called to ensure that all records are updated together.
getDefaultSourceHandler() : \XenForo_Search_SourceHandler_Abstract
inherited_from | \XenForo_Search_SourceHandler_Abstract::getDefaultSourceHandler() |
---|
getGeneralOrderClause(string $order) : array
inherited_from | \XenForo_Search_SourceHandler_Abstract::getGeneralOrderClause() |
---|
string
User-requested order
array
Structured order clause, array of arrays. Child array keys: 0 = table alias, 1 = field, 2 = dir (asc/desc)getMetadataKey(string $keyName, string | array $value) : string | array
string
Type of metadata
string
array
Metadata value; if an array, gets metadata for each value
string
array
String if $value was a string, array if $value was an arrayinsertIntoIndex(string $contentType, integer $contentId, string $title, string $message, integer $itemDate, integer $userId, integer $discussionId, array $metadata)
This must also update (replace) an existing record, if the (type, id) pair already exists.
see | \global\XenForo_Search_SourceHandler_Abstract::insertIntoIndex() |
---|
string
integer
string
string
integer
Time stamp for the content (this will be used in date limits and sorts)
integer
User that created the content
integer
ID of discussion or other grouping container
array
Arbitrary list of other metadata that should be indexed if possible
parseTokenizedQuery(array $query, array $processedConstraints) : string
Metadata will also be searched in the query.
array
Tokenized query
array
Constraints, in source-agnostic format
string
Query ready for MySQLprocessConstraints(array $constraints, \XenForo_Search_DataHandler_Abstract $typeHandler) : array
inherited_from | \XenForo_Search_SourceHandler_Abstract::processConstraints() |
---|
array
List of constraints: [constraint name] => limit (may be scalar or array)
array
Processed constraints. Names as keys, value is 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).searchGeneral(string $searchQuery, array $constraints, string $order, integer $maxResults) : array
This will usually be across all types of content, but could be limited but only using standard constraints.
inherited_from | \XenForo_Search_SourceHandler_Abstract::searchGeneral() |
---|
string
Text to search for
array
Constraints to apply; handled by source handlers
string
Ordering; handled by source handlers
integer
Maximum number of results to return
array
Search results: [] => array(content_type => x, content_id => y)searchType(\XenForo_Search_DataHandler_Abstract $typeHandler, string $searchQuery, array $constraints, string $order, boolean $groupByDiscussion, integer $maxResults) : array
inherited_from | \XenForo_Search_SourceHandler_Abstract::searchType() |
---|
string
Text to search for
array
Constraints to apply; handled by source handlers
string
Ordering; handled by source handlers
boolean
If true, fold/group the results by the discussion_id value
integer
Maximum number of results to return
array
Search results: [] => array(content_type => x, content_id => y)setIsRebuild(boolean $rebuild)
If true, behavior may be modified to be less asynchronous.
inherited_from | \XenForo_Search_SourceHandler_Abstract::setIsRebuild() |
---|
boolean
setSearcher(\XenForo_Search_Searcher $searcher)
This will be used for things like error tracking.
inherited_from | \XenForo_Search_SourceHandler_Abstract::setSearcher() |
---|
splitWords(string $words) : array
string
array
supportsRelevance() : \boolean;
If false, it will not be made available as a sorting option.
\boolean;
tokenizeQuery(string $query) : array
string
array
Tokenized query, [] => array(0 => modifier (empty, +, -, |), 1 => term). Term will include ".." if given.updateIndex(string $contentType, integer $contentId, array $fieldUpdates)
Metadata cannot be updated this way.
see | \global\XenForo_Search_SourceHandler_Abstract::updateIndex() |
---|
string
integer
array
Key-value pairs to change
warning(\XenForo_Phrase | string $message, string $field)
This will be shown to the user on the search results page.
inherited_from | \XenForo_Search_SourceHandler_Abstract::warning() |
---|
string
Field warning applies to
_getDb() : \Zend_Db_Adapter_Abstract
inherited_from | \XenForo_Search_SourceHandler_Abstract::_getDb() |
---|
\Zend_Db_Adapter_Abstract
_pushToIndex(string | array $record)
string
array
A record (SQL) or array of SQL
$stopWords
$_bulkInsertLength
$_bulkInserts
$_db : \Zend_Db_Adapter_Abstract
inherited_from | \XenForo_Search_SourceHandler_Abstract::$$_db |
---|
$_isRebuild : boolean
inherited_from | \XenForo_Search_SourceHandler_Abstract::$$_isRebuild |
---|
$_minWordLength : integer
Used for error/warning detection.
$_searcher : \XenForo_Search_Searcher | null
inherited_from | \XenForo_Search_SourceHandler_Abstract::$$_searcher |
---|
SPLIT_CHAR_RANGES