Squiz Matrix
4.12.2
|
Public Member Functions | |
__construct ($assetid=0) | |
create (Array &$link) | |
_getName ($short_name=FALSE) | |
canDelete () | |
canClone () | |
onAssetUpdate (&$broadcaster, $vars=Array()) | |
onAssetCreate (&$broadcaster, $vars=Array()) | |
onAssetStatusUpdate (&$broadcaster, $vars=Array()) | |
onAttributeChange (&$broadcaster, $vars=Array()) | |
onContentsUpdated (&$broadcaster, $vars=Array()) | |
onAssetDeleted (&$broadcaster, $vars=Array()) | |
onContextDelete (&$broadcaster, $vars=Array()) | |
reindexAsset (&$asset, $vars=Array()) | |
reindexAttributes (&$asset, $vars=Array(), $all_contexts=FALSE) | |
reindexContents (&$asset, $vars=Array(), $all_contexts=FALSE) | |
getIndexingAssetid (&$asset) | |
getIndexableAssetContent (&$asset, $changed_vars) | |
getIndexableAttributeContent (&$asset, $changed_vars, $all_contexts=TRUE) | |
getIndexableContent (&$asset) | |
addIndexableContent ($assetid, &$index_content) | |
flushIndexableContent ($assetid, $components=Array(), $contextids=NULL) | |
flushDefaultIndexableContent ($assetid, $components=Array()) | |
getIndexedComponents ($assetid) | |
getAssetidsByWordIntersection ($source_id, $type=NULL) | |
getIndexableAssetComponents () | |
getIndexableAttributes ($type_code) | |
isAttributeIndexable ($attrid) | |
isAssetIndexable ($assetid) | |
isWordIndexable ($word) | |
_getRawNumberInText ($value) | |
onMetadataUpdate (&$broadcaster, $vars=Array()) | |
onMetadataDeleted (&$broadcaster, $vars=Array()) | |
reindexMetadata ($assetid, $vars=Array(), $all_contexts=FALSE) | |
getIndexableMetadataContent (&$asset, $fieldids=Array(), $all_contexts=TRUE) | |
getWeightings ($assetid) | |
getMetadataWeighting ($assetid, $fieldid) | |
_getLocalMetadataWeightings ($weightings, $fieldid, $sectionid, $schemaids) | |
getAssetTypeWeightings ($type_code=NULL, $strict_type_code=FALSE) | |
getAssetTreeWeightings ($assetid=NULL, $strict_assetid=TRUE, $strict_type_code=FALSE, $type_weights_only=TRUE, $include_global_weights=TRUE) | |
saveAssetTreeWeightings ($asset_tree_weightings) | |
getAssetWeightings ($assetid=NULL) | |
saveAssetWeightings ($asset_weightings) | |
getMetadataWeightings ($assetid=NULL) | |
saveMetadataWeightings ($metadata_weightings) | |
_saveWeightings ($weightings, $type) | |
extractKeywords (&$asset, $include_metadata=FALSE, $include_scores=FALSE) | |
_strip_tags ($tags, $contents) | |
generateWordList ($words) | |
processSearch ($search_info, $include_context=FALSE) | |
_prepareSearchField (&$field_details) | |
_processWordSearch ($search_term, $data_source, $base_query, $word_logic='AND') | |
_processDateSearch ($date_range, $data_source, $base_query) | |
_processNumericSearch ($numeric_range, $data_source, $base_query) | |
_combineResults ($results_so_far, $new_results, $logic) | |
processBasicSearch ($search_info) | |
spellCheckWord ($word, $language=SQ_TOOL_SPELL_CHECKER_LANG) | |
spellCheckAvailable () | |
constructBaseSearchQuery ($search_info) | |
combineAssetScores ($asset_scores1, $asset_scores2, $logic='AND', $word=NULL) | |
getNoiseWords () | |
getWhiteWords () | |
isNoiseWord ($word) | |
isWhiteWord ($word) | |
getMinWordLength () | |
& | _getDBPlugin () |
getCondensedResults ($results) | |
getFormattedResults ($results, $search_string, $full_content=TRUE) | |
Public Member Functions inherited from Asset | |
Asset ($assetid=0) | |
create (Array &$link) | |
load ($assetid) | |
_loadDataPaths () | |
reload () | |
canDelete () | |
delete ($release_lock=TRUE, $check_locked=TRUE) | |
useSystemVersion () | |
loadSystemVersion () | |
saveSystemVersion () | |
clearSystemVersion () | |
revertToSystemVersion () | |
revertNoticeLinksToSystemVersion () | |
_updated ($update_parents=TRUE) | |
type () | |
getTypeAncestors ($include_asset=TRUE) | |
incrementVersion ($number='micro', $update_parents=TRUE) | |
getLanguages () | |
setLanguages (Array $languages) | |
setCharset ($charset) | |
setForceSecure ($force_secure) | |
remapAssetids (Array $map) | |
morph ($new_type_code) | |
_morphCleanup ($new_type_code) | |
onRequestKeywords (Asset $broadcaster, Array $vars=Array()) | |
canClone () | |
cloneComponents (Asset $clone, Array $components, $override=FALSE) | |
cloneComponentsAdditional (Asset $clone, Array $components) | |
cloneLinks (Asset $clone) | |
getStatus () | |
getAvailableStatii () | |
getStatusDescription () | |
processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE) | |
setDate ($date_type, $time=NULL, $userid=NULL) | |
lockTypes () | |
canForceablyAcquireLock ($lock_type) | |
getEditingLocks ($keywords) | |
_getAllowedLinks () | |
createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0) | |
prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive) | |
canCreateLink (Asset $minor, $link_type, $exclusive) | |
canMoveLink (Asset $minor, Asset $old_major, $link_type) | |
describeLink ($linkid) | |
isDeletableLink ($linkid) | |
canDeleteLink ($linkid) | |
deleteLink ($linkid, $check_locked=TRUE) | |
linksUpdated () | |
canCloneLink () | |
saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE) | |
setAttrValue ($name, $value) | |
attr ($name) | |
& | attrByRef ($name) |
getAttribute ($name, $mute_errors=FALSE) | |
getAssetKeywords ($descriptions=FALSE) | |
getAvailableKeywords () | |
getKeywordReplacement ($keyword) | |
getAssetWebPathKeywordReplacement () | |
getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE) | |
processCustomKeywords ($keywords=Array()) | |
getContent () | |
setContent () | |
getEffectiveLastUpdatedTime ($assetids) | |
readAccess (Array $assetids=Array()) | |
writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE) | |
adminAccess ($lock_type='', Array $assetids=Array()) | |
backendAccess () | |
liveEditAccess ($lock_type) | |
canliveEdit ($lock_type) | |
effectiveUnrestricted () | |
checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE) | |
accessEffective () | |
permissionsUpdated () | |
printFrontend () | |
printFrontendAsset (Asset $asset, $design=NULL) | |
getValidProtocols () | |
printHead () | |
printBody () | |
getCurrentPaintLayoutName () | |
getCurrentDesignName () | |
printBodyWithPaintLayout ($layout_id='') | |
initLimbo () | |
printLimbo () | |
paintBackend (Backend_Outputter $o) | |
getPrefix () | |
processBackend (Backend_Outputter $o, Array &$link) | |
getEI () | |
getEditFns () | |
getBackendHref ($screen='', $backend_page=TRUE) | |
getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL) | |
getURLs () | |
getHref ($base_url=NULL, $ignore_rollback=FALSE) | |
getWebDataPath () | |
getWebPaths () | |
saveWebPaths ($paths, $auto_add_remaps=TRUE) | |
getLookups ($field='') | |
getDesignLookups () | |
getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE) | |
deleteLookupValue ($layout_name, $layout_value) | |
setPaintLayouts ($layouts) | |
updateLookups ($auto_add_remaps=TRUE) | |
setLookupValues (Array $values) | |
getAssetStatusDescriptionKeywordReplacement () | |
getAssetStatusColourKeywordReplacement () | |
replaceKeywordsInString ($string) | |
fastTrack ($tasks) | |
unFastTrack ($tasks) | |
shouldFastTrack ($task, $assetid=NULL) | |
getFaskTrackedTaskAssetids ($task) | |
getDependantParentsURL () | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Data Fields | |
$standard_date_fields = NULL | |
$standard_text_fields = NULL | |
$_db_plugin = NULL | |
Data Fields inherited from Asset | |
$id = 0 | |
$version = '' | |
$name = '' | |
$short_name = '' | |
$status | |
$languages = '' | |
$charset = '' | |
$force_secure = '0' | |
$created | |
$created_userid | |
$updated | |
$updated_userid | |
$published | |
$published_userid | |
$status_changed | |
$status_changed_userid | |
$_is_cacheable = FALSE | |
$vars = Array() | |
$_available_keywords = Array() | |
$data_path_suffix = '' | |
$data_path = '' | |
$data_path_public = '' | |
$_ser_attrs = FALSE | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Additional Inherited Members | |
Protected Member Functions inherited from Asset | |
_preCreateCheck (Array &$link) | |
_createAdditional (Array &$link) | |
_abortCreate ($trigger_level_changed=FALSE, $linkid=0) | |
_loadVars () | |
_getName ($short_name=FALSE, $contextid=NULL) | |
_getKeywordReplacement ($keyword) | |
_checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE) | |
makeAndSaveInitialWebPath ($path, $parent_link=NULL) | |
Definition at line 31 of file search_manager.inc.
__construct | ( | $assetid = 0 | ) |
Constructor
int | $assetid | the asset id to be loaded |
Definition at line 52 of file search_manager.inc.
_combineResults | ( | $results_so_far, | |
$new_results, | |||
$logic | |||
) |
Combine new results with results so far
If $results_so_far is null, $new_results are always returned. Otherwise if logic is 'AND' the return value contains only the results that are in both the first two params, with search scores added. If logic is 'OR' then the return value contains all results that are in either of the first two params, with search scores added for common results. This function can handle results with or without context (ie getAll or getAssoc return format)
array | $results_so_far | Results so far. Null if no results so far |
array | $new_results | New results |
string | $logic | 'AND'|'OR' |
Definition at line 2806 of file search_manager.inc.
& _getDBPlugin | ( | ) |
Gets the appropriate plugin for the database engine
Database plugins live in the plugins/[db-type] sub-folder of the Search Manager and have a class name of Search_Manager_Plugin_[db-type]
Definition at line 3482 of file search_manager.inc.
_getLocalMetadataWeightings | ( | $weightings, | |
$fieldid, | |||
$sectionid, | |||
$schemaids | |||
) |
Returns the metadata weightings for a fieldid from the appropriate metadata asset
Drills up the metadata tree going from the field => section => schema to find any metadata weightings applicable for this field Returns the weighting for the field or false if the fieldid is not to be indexed -1 if no weighting could be found
array | $weightings | the weightigns to search |
string | $fieldid | the fieldid of the metadata field |
string | $sectionid | the sectionid that the field is a child of |
string | $schemaids | the schemaid that the section is a child of |
Definition at line 1830 of file search_manager.inc.
_getName | ( | $short_name = FALSE | ) |
Returns name of the asset
boolean | $short_name | whether or not we are after the shortname or the full name |
Definition at line 117 of file search_manager.inc.
_getRawNumberInText | ( | $value | ) |
Checks to see if the specified text is just a number representation.
If the text is just a number representation, the number is returned with its spaces and delimiters stripped, otherwise the string is returned unchanged
string | $value | the text to check |
Definition at line 1316 of file search_manager.inc.
_prepareSearchField | ( | & | $field_details | ) |
Prepares the supplied search field for searching
If all datasources are of type datetime, makes sure the 'words' array is appropriately set up as a date range. Otherwise gets the words from the search string, makes them into an array and removes unindexable words. Data sources that are not properly initialised are removed
array | &$field_details | One entry from the 'fields' array in processSearch()'s search_info parameter |
Definition at line 2521 of file search_manager.inc.
_processDateSearch | ( | $date_range, | |
$data_source, | |||
$base_query | |||
) |
Search for a date range in a particular data source
string | $date_range | Range of dates to search for |
array | $data_source | Details of the data source to search in |
array | $base_query | The base of the sql query to use |
Definition at line 2718 of file search_manager.inc.
_processNumericSearch | ( | $numeric_range, | |
$data_source, | |||
$base_query | |||
) |
Search for a numeric range in a particular data source
string | $numeric_range | Range of numbers to search for |
array | $data_source | Details of the data source to search in |
array | $base_query | The base of the sql query to use |
Definition at line 2759 of file search_manager.inc.
_processWordSearch | ( | $search_term, | |
$data_source, | |||
$base_query, | |||
$word_logic = 'AND' |
|||
) |
Processes a search for a particular word in a particular data source
string | $search_term | Word to search for |
array | $data_source | Details of the data source to search in |
array | $base_query | The base of the sql query to use |
string | $word_logic | Word logic (for DBs that don't split up their terms here, ie. Oracle) |
Definition at line 2677 of file search_manager.inc.
_saveWeightings | ( | $weightings, | |
$type | |||
) |
Saves the weightings to the specified file
array | $weightings | the weightings to save |
string | $type | the type of weightings, which should be one of asset_type, asset, asset_tree |
Definition at line 2138 of file search_manager.inc.
_strip_tags | ( | $tags, | |
$contents | |||
) |
Strip tags by tag name
array | $tags | the array of tag names, e.g. Array('span', 'b', 'i') |
string | $contents | the string that contains tags |
Definition at line 2199 of file search_manager.inc.
addIndexableContent | ( | $assetid, | |
& | $index_content | ||
) |
Adds the specified index content for the specified assetid to the indexing system
string | $assetid | the assetid to index the content under |
array | &$index_content | the content to index |
Definition at line 837 of file search_manager.inc.
canClone | ( | ) |
returns FALSE always because we don't want to be able to clone a search manager
Definition at line 143 of file search_manager.inc.
canDelete | ( | ) |
Can this asset have its last significant link removed (putting it in the trash)?
Definition at line 130 of file search_manager.inc.
combineAssetScores | ( | $asset_scores1, | |
$asset_scores2, | |||
$logic = 'AND' , |
|||
$word = NULL |
|||
) |
Combines asset scores according to the passed logic
Returns a mapping from assetids to combined scores
array | $asset_scores1 | a mapping from assetids to scores |
array | $asset_scores2 | a mapping from assetids to scores |
string | $logic | either 'AND' or 'OR' |
string | $word | word |
Definition at line 3325 of file search_manager.inc.
constructBaseSearchQuery | ( | $search_info | ) |
Populates a search query array given an array of search settings
Accepts the same search info array as processSearch() Does not put the search index table or anything like that in the query Returns components of search query in a format ready for implode_sql()
We end up with a subquery from this method which the calling code then uses to restrict which assets the search index table will look at.
We end up with something like this for the subquery: select assetid from sq_ast inner join sq_ast_lnk inner join sq_ast_lnk_tree ... where tree.node like ('starting_tree_id') and assetid in ( select assetid from sq_ast_perm ... check all permissions are ok here. )
array | $search_info | an array of search settings |
This is the main query that is returned. We only need to specify the from table and alias here The select fields are worked out by the calling method based on what is being searched and what it has been set up to return.
The subquery is the part that restricts the search based on:
This becomes part of the subquery of $subquery at the end if we are restricting based on roles/groups/permissions.
Now we've worked out all of the restrictions:
If/only if we are checking permissions, make the permission checking a subquery off the other sub query. No need to include this if we're not checking permissions.
Add an extra condition here. We can push the assetid check (retrieved in the outer query) into the subquery as well which speeds up permission checking
put the base permission check query together
we use it as a subquery: .. a.assetid IN ( permission_check_query )
If we're using oracle, then do an IN() query We can't use the join trick below because it gives an error about "inconsistent datatypes"
If we're using postgres, do it as a JOIN instead it gives much better performance
Definition at line 3021 of file search_manager.inc.
create | ( | Array & | $link | ) |
Create this asset
array | &$link | information used to create the initial link |
Definition at line 81 of file search_manager.inc.
extractKeywords | ( | & | $asset, |
$include_metadata = FALSE , |
|||
$include_scores = FALSE |
|||
) |
Extracts keywords from the indexing table and ranks them in order of descending importance
object | &$asset | The asset whose keywords are to be extracted |
boolean | $include_metadata | If false, metadata components are excluded |
boolean | $include_scores | Determines whether scores are returned (true) or just the keywords (false). Affects return value. |
Definition at line 2180 of file search_manager.inc.
flushDefaultIndexableContent | ( | $assetid, | |
$components = Array() |
|||
) |
Flush all 'default' indexed data for an asset
Default indexed data are values indexed from a non-contextable attribute, or a contextable attribute using the default value.
If the components argument is provided, only those components will be flushed. Otherwise, all components of that asset will be deleted from the search index.
int | $assetid | ID of the asset |
array | $components | the components to which the keydata pertains (e.g. metadata or attribute) |
array | $contextids | Array of context IDs to flush key data. If omitted, all contexts (including defaults) will be flushed. |
Definition at line 1105 of file search_manager.inc.
flushIndexableContent | ( | $assetid, | |
$components = Array() , |
|||
$contextids = NULL |
|||
) |
Flush the keydata for an asset
If the components argument is provided, only those components will be flushed. Otherwise, all components of that asset will be deleted from the search index.
int | $assetid | ID of the asset |
array | $components | the components to which the keydata pertains (e.g. metadata or attribute) |
array | $contextids | Array of context IDs to flush key data. If omitted, all contexts (including defaults) will be flushed. |
Definition at line 1041 of file search_manager.inc.
generateWordList | ( | $words | ) |
Generates a word list from the search string
string | $words | the words string |
Definition at line 2228 of file search_manager.inc.
getAssetidsByWordIntersection | ( | $source_id, | |
$type = NULL |
|||
) |
Get ids of assets having same words as the supplied asset
string | $source_id | ID of the asset |
string | $type | type of the asset to restrict the search by |
Definition at line 1181 of file search_manager.inc.
getAssetTreeWeightings | ( | $assetid = NULL , |
|
$strict_assetid = TRUE , |
|||
$strict_type_code = FALSE , |
|||
$type_weights_only = TRUE , |
|||
$include_global_weights = TRUE |
|||
) |
Returns the Asset Tree weightings for the specified assetid, or all weightings registered for asset trees if the specified assetid is null
string | $assetid | the assetid of the wanted tree weightings or null for all asset tree weightings |
boolean | $strict_assetid | if TRUE only weightings that have been customised explicitly using the specified assetid will be returned, otherwise the closest weighting customisation will be returned |
boolean | $strict_type_code | if TRUE only weightings matching the asset type of the specified assetid will be returned |
boolean | $type_weights_only | Applies only if $assetid is not NULL and $strict_assetid is FALSE. if TRUE only type weights data according to $strict_type_code is returned. if FALSE $strict_type_code is ineffective & both type_weights & metadata_weights data is returned. |
boolean | $include_global_weights | if TRUE, the asset tree weights will include the root folder weight which defines global weights. |
Definition at line 1936 of file search_manager.inc.
getAssetTypeWeightings | ( | $type_code = NULL , |
|
$strict_type_code = FALSE |
|||
) |
Returns the Asset Type weightings for the specified asset type, or all asset types if the specified type code is null
string | $type_code | the type code of the wanted weightings, or null for all asset type weightings |
boolean | $strict_type_code | strict or inherit type code |
Definition at line 1885 of file search_manager.inc.
getAssetWeightings | ( | $assetid = NULL | ) |
Returns the Asset Type weightings
string | $assetid | the assetid of the wanted weightings if null, weightings for all assets set will be returned |
Definition at line 2051 of file search_manager.inc.
getCondensedResults | ( | $results | ) |
Reduce results to be keyed based on asset ID
array | $results | raw results array |
Definition at line 3506 of file search_manager.inc.
getFormattedResults | ( | $results, | |
$search_string, | |||
$full_content = TRUE |
|||
) |
Provide generic format of search results data
Results array is in the format returned by search manager when a detailed searched is made
array | $results | CONDENSED search results (returned by getCondensedResults()) |
string | $search_string | string searched for |
string | $full_content | return full formatted content or not |
Definition at line 3541 of file search_manager.inc.
getIndexableAssetComponents | ( | ) |
Returns a list of indexable compents for all assets
Definition at line 1197 of file search_manager.inc.
getIndexableAssetContent | ( | & | $asset, |
$changed_vars | |||
) |
Returns the indexable standard field content for the specified asset
object | &$asset | the asset to obtain the indexable content for |
array | $changed_vars | the asset vars that have changed |
Definition at line 547 of file search_manager.inc.
getIndexableAttributeContent | ( | & | $asset, |
$changed_vars, | |||
$all_contexts = TRUE |
|||
) |
Returns the indexable content for the specified asset's attributes
object | &$asset | the asset to obtain the indexable content for |
array | $changed_vars | attributes that have been changed |
Definition at line 638 of file search_manager.inc.
getIndexableAttributes | ( | $type_code | ) |
Returns a list of indexable components for a specified asset type
string | $type_code | the type code |
Definition at line 1223 of file search_manager.inc.
getIndexableContent | ( | & | $asset | ) |
Returns the content for the specfied asset
object | &$asset | the asset to obtain the indexable content for |
Definition at line 796 of file search_manager.inc.
getIndexableMetadataContent | ( | & | $asset, |
$fieldids = Array() , |
|||
$all_contexts = TRUE |
|||
) |
Returns the indexable metadata content for the specified asset
object | &$asset | The asset to get the indexable content fors |
array | $fieldids | Array of fieldid => type_code to limit to |
boolean | $all_contexts | TRUE = attributes are reindexed in all contexts. FALSE = only current context is reindexed |
Definition at line 1454 of file search_manager.inc.
getIndexedComponents | ( | $assetid | ) |
Returns a list of components that the specified asset has indexed
string | $assetid | the assetid of the wanted components |
Definition at line 1148 of file search_manager.inc.
getIndexingAssetid | ( | & | $asset | ) |
Returns the assetid in which content should be indexed under for the specified asset
object | &$asset | the asset to find the indexing asset for |
Definition at line 519 of file search_manager.inc.
getMetadataWeighting | ( | $assetid, | |
$fieldid | |||
) |
Returns the metadata weightings for the specified assetid and metadata fieldid
The following presedence rules are followed in order when finding the weightings for a particular asset:
string | $assetid | the assetid to get the weightings for |
string | $fieldid | the fieldid of the metadata field |
Definition at line 1754 of file search_manager.inc.
getMetadataWeightings | ( | $assetid = NULL | ) |
Returns the Asset Type weightings
string | $assetid | the assetid of the wanted weightings if null, weightings for all assets set will be returned |
Definition at line 2095 of file search_manager.inc.
getMinWordLength | ( | ) |
Return the minimum indexable word lenght
Definition at line 3466 of file search_manager.inc.
getNoiseWords | ( | ) |
Return an array of noise words
Definition at line 3402 of file search_manager.inc.
getWeightings | ( | $assetid | ) |
Returns the weightings for an assets core components and its attributes
The Following presedence rules are followed in order when finding the weightings for a particular asset:
Weightings are now cached inside the search manager, per asset, to improve performance (instead of loading up the cached weightings file four times for a reindex, it only gets loaded once). Cached weightings are unset when the weightings are saved in _saveWeightings().
string | $assetid | the assetid to obtain the weightings for |
Definition at line 1675 of file search_manager.inc.
getWhiteWords | ( | ) |
Return an array of white words
Definition at line 3415 of file search_manager.inc.
isAssetIndexable | ( | $assetid | ) |
Returns TRUE if the specified asset is indexable
string | $assetid | the assetid to check |
Definition at line 1262 of file search_manager.inc.
isAttributeIndexable | ( | $attrid | ) |
Returns TRUE if the specified attribute is indexable
int | $attrid | the attribute id |
Definition at line 1246 of file search_manager.inc.
isNoiseWord | ( | $word | ) |
Return true if word is in noise words
string | $word | The word to compare |
Definition at line 3430 of file search_manager.inc.
isWhiteWord | ( | $word | ) |
Return true if word is in white words
string | $word | The word to compare |
Definition at line 3449 of file search_manager.inc.
isWordIndexable | ( | $word | ) |
Check if the word is indexable
Check is performed according to the current indexing parameters
string | $word | word to check |
Definition at line 1289 of file search_manager.inc.
onAssetCreate | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an asset is created
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Component is set as $vars['component'] |
Definition at line 183 of file search_manager.inc.
onAssetDeleted | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an asset gets deleted. We want to flush any key data in the index table
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Component is set as $vars['component'] |
Definition at line 263 of file search_manager.inc.
onAssetStatusUpdate | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an asset has its status changed
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Component is set as $vars['component'] |
Definition at line 204 of file search_manager.inc.
onAssetUpdate | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an asset is updated
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Component is set as $vars['component'] |
Definition at line 163 of file search_manager.inc.
onAttributeChange | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an assets atrtributes have changed
object | &$broadcaster | the asset that triggered the event |
array | $vars | a list of attributes that have changed |
Definition at line 223 of file search_manager.inc.
onContentsUpdated | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when an asset is created
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Component is set as $vars['component'] |
Definition at line 243 of file search_manager.inc.
onContextDelete | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when a context gets deleted.
We want to flush any key data in the index table related to that context. This is necessary because the values may linger in the table, and cause key duplication issues.
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster Context deleted is set as $vars['contextid'] |
Definition at line 285 of file search_manager.inc.
onMetadataDeleted | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when metadata manager wants some metadata deleted
object | &$broadcaster | the asset that triggered the event (should be meta. mgr) |
array | $vars | the vars that get submitted by the broadcaster Asset ID is set as $vars['assetid'] Schema Asset IDs is set as $vars['schemaids'] |
Definition at line 1372 of file search_manager.inc.
onMetadataUpdate | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Event fired when metadata manager wants some metadata reindexed
object | &$broadcaster | the asset that triggered the event (should be meta. mgr) |
array | $vars | the vars that get submitted by the broadcaster Asset ID is set as $vars['assetid'] Schema Asset IDs is set as $vars['schemaids'] |
Definition at line 1350 of file search_manager.inc.
processBasicSearch | ( | $search_info | ) |
Processes a basic search request without search terms
Accepts the same input array as processSearch but does not use any search terms
array | $search_info | an array of search settings |
Definition at line 2872 of file search_manager.inc.
processSearch | ( | $search_info, | |
$include_context = FALSE |
|||
) |
Processes a search request Formulates search query and returns the results
Each search request is logged to the 'search' log in the format:
Array('terms' => array ( first term => count of result assets for this term only second term => ... ), 'results' => total number of result assets for this request, 'assetid' => id of the asset requesting this search );
This array will be in the 'data' section of the log entry (to be accessed via the log manager)
array | $search_info | an array of search settings in the form 'requester' => ID of asset that requested the search 'asset_types' => Array of type code => whether to inherit 'statuses' => Array of asset statuses, or empty array for default of live+ 'roots' => Array of assetids to use as roots for the search 'root_logic' => 'AND'|'OR', depending on whether we want a result to be under all roots or any root 'fields' => Array( field_name => Array( 'words' => 'cat sat mat', 'word_logic' => 'AND'|'OR' (all words or any word, default 'AND') 'data_source_logic' => 'AND'|'OR' (all DSes or any DS, default 'OR') 'data_sources' => Array( i => Array( 'type' => 'asset_attrib' for eg 'params' => Array(...) ), ), ), ), 'field_logic' => 'AND'|'OR', depending on whether we want results that match all fields or any field 'exclude' => Array of words to exclude from results |
boolean | $include_context | Whether to include the context in which the match was found |
Definition at line 2280 of file search_manager.inc.
reindexAsset | ( | & | $asset, |
$vars = Array() |
|||
) |
Reindex this asset and, if specified, the metadata associated with this asset
No multi-context support is required here, as standard asset fields and metadata do not vary based on context.
object | &$asset | the asset to reindex |
array | $vars | the components to reindex - 'asset' to reindex the core components of the asset, and 'metadata' to reindex metadata or 'all' for both |
Definition at line 310 of file search_manager.inc.
reindexAttributes | ( | & | $asset, |
$vars = Array() , |
|||
$all_contexts = FALSE |
|||
) |
Reindex the specified asset's attributes
With multi-context searching, extra parameters have been added. The $all_contexts flag will be set to TRUE when a "all contexts reindex" is necessary. This will be when the Reindex HIPO job is called, or when the asset is first created.
object | &$asset | the asset to reindex |
array | $vars | a list of attribute names that have changed |
boolean | $all_contexts | TRUE = attributes are reindexed in all contexts. FALSE = only current context is reindexed. |
Definition at line 358 of file search_manager.inc.
reindexContents | ( | & | $asset, |
$vars = Array() , |
|||
$all_contexts = FALSE |
|||
) |
Reindex the specified asset's custom contents
With multi-context searching, extra parameters have been added. The $all_contexts flag will be set to TRUE when a "all contexts reindex" is necessary. This will be when the Reindex HIPO job is called. (Contents are not reindexed when the asset is first created.)
object | &$asset | the asset to reindex |
array | $vars | a list of attribute names that have changed |
boolean | $all_contexts | If TRUE, the asset contents wil be reindexed from all contexts' perspective. FALSE = only current context. |
Definition at line 456 of file search_manager.inc.
reindexMetadata | ( | $assetid, | |
$vars = Array() , |
|||
$all_contexts = FALSE |
|||
) |
Re-indexes the metadata components for the specified asset
string | $assetid | the assetid to reindex |
array | $vars | the schemas to renidex |
boolean | $all_contexts | TRUE = attributes are reindexed in all contexts. FALSE = only current context is reindexed. |
Definition at line 1395 of file search_manager.inc.
saveAssetTreeWeightings | ( | $asset_tree_weightings | ) |
Saves the asset tree weightings to file
array | $asset_tree_weightings | the complete asset tree weightings to save |
Definition at line 2034 of file search_manager.inc.
saveAssetWeightings | ( | $asset_weightings | ) |
Saves the Asset Weightings
array | $asset_weightings | the array of weights to save |
Definition at line 2078 of file search_manager.inc.
saveMetadataWeightings | ( | $metadata_weightings | ) |
Saves the metadata weightings to file
array | $metadata_weightings | the complete metadata weightings to save |
Definition at line 2121 of file search_manager.inc.
spellCheckAvailable | ( | ) |
Returns true if the spell checker is available
Written as a wrapper function so that if the spell-checker changes for some reason, then this can be updated. It currently just checks whether the pSpell extension is available.
Definition at line 2989 of file search_manager.inc.
spellCheckWord | ( | $word, | |
$language = SQ_TOOL_SPELL_CHECKER_LANG |
|||
) |
Spell-checks a word and returns a list of suggestions if available
This function checks for the existence of the pSpell extension. If it does not exist (eg. Windows server), or an error otherwise occurs in the loading of the pSpell instance, we will proceed as if no suggestions are available.
string | $word | the word to be checked |
string | $language | the language to be used to spell-check |
Definition at line 2938 of file search_manager.inc.