deleteFromIndex()
error()
executeSearch()
executeSearchByUserId()
finalizeRebuildSet()
getDefaultSourceHandler()
getGeneralOrderClause()
insertIntoIndex()
processConstraints()
searchGeneral()
searchType()
setIsRebuild()
setSearcher()
supportsRelevance()
updateIndex()
warning()
_getDb()
$_db
$_isRebuild
$_searcher
Abstract representation of a search source.
package | XenForo_Search |
---|
deleteFromIndex(string $contentType, array $contentIds)
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.
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.
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
getGeneralOrderClause(string $order) : array
string
User-requested order
array
Structured order clause, array of arrays. Child array keys: 0 = table alias, 1 = field, 2 = dir (asc/desc)insertIntoIndex(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.
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
processConstraints(array $constraints, \XenForo_Search_DataHandler_Abstract $typeHandler) : array
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.
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
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.
boolean
setSearcher(\XenForo_Search_Searcher $searcher)
supportsRelevance() : boolean
If false, it will not be made available as a sorting option.
boolean
updateIndex(string $contentType, integer $contentId, array $fieldUpdates)
Metadata cannot be updated this way.
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.
string
Field warning applies to
_getDb() : \Zend_Db_Adapter_Abstract
\Zend_Db_Adapter_Abstract
$_db : \Zend_Db_Adapter_Abstract
$_isRebuild : boolean