Squiz Matrix
4.12.2
|
Public Member Functions | |
__construct () | |
processWordSearch (&$sm, $search_term, $data_source, $base_query, $word_logic='AND') | |
processNumericSearch (&$sm, $numeric_range, $data_source, $base_query) | |
processDateSearch (&$sm, $date_range, $data_source, $base_query) | |
processExcludeQuery (&$sm, $search_term, $base_query) | |
constructBaseSearchQuery ($search_info) | |
extractKeywords (&$asset, $include_metadata=FALSE, $include_scores=FALSE) | |
generateWordList ($words) | |
splitIndexableContent ($contents, $type_code, $data_type, $component, $weighting, $contextid, $use_default) | |
handleMultipleMetadataSelect ($value) | |
getAssetidsByWordIntersection ($source_id, $type=NULL) | |
getMaxWordLength () | |
getWords ($search_string) | |
getSearchListAssets (&$search_list, &$search_page) | |
Definition at line 29 of file search_manager_plugin_pgsql.inc.
__construct | ( | ) |
Constructor
Definition at line 40 of file search_manager_plugin_pgsql.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()
array | $search_info | an array of search settings |
Definition at line 448 of file search_manager_plugin_pgsql.inc.
extractKeywords | ( | & | $asset, |
$include_metadata = FALSE , |
|||
$include_scores = FALSE |
|||
) |
Extracts keywords from the indexing table and ranks them in order of descending importance
If $include_scores is TRUE, the returned array is of (keyword => score). If it is FALSE, the array is of (keyword) without any particular key
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) |
Definition at line 610 of file search_manager_plugin_pgsql.inc.
generateWordList | ( | $words | ) |
Generates a word list from the search string
string | $words | the words string |
Definition at line 662 of file search_manager_plugin_pgsql.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 783 of file search_manager_plugin_pgsql.inc.
getMaxWordLength | ( | ) |
Get the maximum size of a search index field
Definition at line 821 of file search_manager_plugin_pgsql.inc.
getSearchListAssets | ( | & | $search_list, |
& | $search_page | ||
) |
Get the list of assets to be printed in Search List Page
object | &$search_list | the reference to Search List Page asset |
object | &$search_page | the reference to Search Page asset |
Definition at line 853 of file search_manager_plugin_pgsql.inc.
getWords | ( | $search_string | ) |
External access to function that gets the list of search terms from the search string
string | $search_string | the terms string |
Definition at line 837 of file search_manager_plugin_pgsql.inc.
handleMultipleMetadataSelect | ( | $value | ) |
Returns the content to be indexed for a multiple metadata select value
By default, values will be stored as a semi-colon separated list; just send that back if you don't want that changed.
string | $value | semi-colon separated list of selected values |
Definition at line 767 of file search_manager_plugin_pgsql.inc.
processDateSearch | ( | & | $sm, |
$date_range, | |||
$data_source, | |||
$base_query | |||
) |
Search for a date range in a particular data source
The $date_range field is a two-value array containing 'from' and 'to' keys. Specifying both will make it a "between" query. Specifying one and leaving the other as NULL will make it a greater/less than (or equal to) query. If both 'from' and 'to' are NULL, then no condition is imposed, and it degenerates into the base query.
object | &$sm | The search manager |
array | $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 310 of file search_manager_plugin_pgsql.inc.
processExcludeQuery | ( | & | $sm, |
$search_term, | |||
$base_query | |||
) |
Search for terms in all components
This can be used for an include all or exclude search - Search Manager will likely use it for the latter.
object | &$sm | The search manager |
string | $search_term | Word to search for |
array | $base_query | The base of the sql query to use |
Definition at line 397 of file search_manager_plugin_pgsql.inc.
processNumericSearch | ( | & | $sm, |
$numeric_range, | |||
$data_source, | |||
$base_query | |||
) |
Search for a numeric range in a particular data source
The $numeric_range field is a two-value array containing 'lower' and 'upper' keys. If both are filled, then it is handled as a 'BETWEEN' query. If one is NULL, then it is handled as a 'greater than' or 'less than' query, depending on which one is NULL. If both are NULL, then no condition is imposed, and it degenerates into the base query.
object | &$sm | The search manager |
array | $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 217 of file search_manager_plugin_pgsql.inc.
processWordSearch | ( | & | $sm, |
$search_term, | |||
$data_source, | |||
$base_query, | |||
$word_logic = 'AND' |
|||
) |
Processes a search for a particular word in a particular data source
Return value is based on what has been set as the 'select' fields in the base query ($base_query). Typically this will be (keyword => score) but this can obviously be changed.
A NULL result means the word was skipped due to not having been indexable in the first place. Terms returning NULL should be ignored for word logic purposes in the Search Manager. A NULL result will never occur for data sources of metadata selection type (including multiple text and hierarchy)
object | &$sm | The search manager |
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 | operator to use for intra-word logic (IGNORED in PostgreSQL as the words are already split up) |
Definition at line 86 of file search_manager_plugin_pgsql.inc.
splitIndexableContent | ( | $contents, | |
$type_code, | |||
$data_type, | |||
$component, | |||
$weighting, | |||
$contextid, | |||
$use_default | |||
) |
Returns the indexable content for the specified asset's attributes
string | $contents | The contents |
string | $type_code | The type code |
string | $data_type | The data type |
string | $component | The component |
string | $weighting | The weighting |
mixed | (int|string) $contextid The contextid (or 'default' if not contextable) | |
boolean | $use_default | TRUE indicates this is a default value |
Definition at line 698 of file search_manager_plugin_pgsql.inc.