|
Open Monograph Press
3.3.0
|
Public Member Functions | |
| __construct () | |
| _getMergedArray ($context, &$keywords, $publishedFrom, $publishedTo) | |
| _getMergedKeywordResults ($context, &$keyword, $type, $publishedFrom, $publishedTo, $resultsPerKeyword, $resultCacheHours) | |
| _getMergedPhraseResults ($context, &$phrase, $type, $publishedFrom, $publishedTo, $resultsPerKeyword, $resultCacheHours) | |
| _parseQuery ($query) | |
| _parseQueryInternal ($signTokens, $tokens, &$pos, $total) | |
| formatResults ($results, $user=null) | |
| getResultSetOrdering ($request) | |
| getResultSetOrderingDirectionOptions () | |
| getResultSetOrderingOptions ($request) | |
| retrieveResults ($request, $context, $keywords, &$error, $publishedFrom=null, $publishedTo=null, $rangeInfo=null, $exclude=array()) | |
Protected Member Functions | |
| getDefaultOrderDir ($orderBy) | |
| getSearchDao () | |
| getSparseArray ($unorderedResults, $orderBy, $orderDir, $exclude) | |
Class for retrieving search results.
FIXME: NEAR; precedence w/o parens?; stemming; weighted counting
Definition at line 35 of file SubmissionSearch.inc.php.
| SubmissionSearch::__construct | ( | ) |
Constructor
Definition at line 39 of file SubmissionSearch.inc.php.
| SubmissionSearch::_getMergedArray | ( | $context, | |
| & | $keywords, | ||
| $publishedFrom, | |||
| $publishedTo | |||
| ) |
Takes an unordered list of search result data, flattens it, orders it and excludes unwanted results.
| $unorderedResults | array An unordered list of search data (article ID as key and ranking data as values). |
| $orderBy | string One of the values returned by ArticleSearch::getResultSetOrderingOptions(); |
| $orderDir | string 'asc' or 'desc', see ArticleSearch::getResultSetOrderingDirectionOptions(); |
| $exclude | array A list of article IDs to exclude from the result. |
Definition at line 117 of file SubmissionSearch.inc.php.
References _getMergedKeywordResults(), and Config\getVar().
Referenced by retrieveResults().
| SubmissionSearch::_getMergedKeywordResults | ( | $context, | |
| & | $keyword, | ||
| $type, | |||
| $publishedFrom, | |||
| $publishedTo, | |||
| $resultsPerKeyword, | |||
| $resultCacheHours | |||
| ) |
Recursive helper for _getMergedArray.
Definition at line 138 of file SubmissionSearch.inc.php.
References _getMergedPhraseResults().
Referenced by _getMergedArray(), and _getMergedPhraseResults().
| SubmissionSearch::_getMergedPhraseResults | ( | $context, | |
| & | $phrase, | ||
| $type, | |||
| $publishedFrom, | |||
| $publishedTo, | |||
| $resultsPerKeyword, | |||
| $resultCacheHours | |||
| ) |
Recursive helper for _getMergedArray.
Definition at line 192 of file SubmissionSearch.inc.php.
References _getMergedKeywordResults(), and getSearchDao().
Referenced by _getMergedKeywordResults().
| SubmissionSearch::_parseQuery | ( | $query | ) |
Parses a search query string. Supports +/-, AND/OR, parens
| $query |
Definition at line 48 of file SubmissionSearch.inc.php.
References _parseQueryInternal(), and PKPString\regexp_match_all().
Referenced by retrieveResults().
| SubmissionSearch::_parseQueryInternal | ( | $signTokens, | |
| $tokens, | |||
| & | $pos, | ||
| $total | |||
| ) |
Query parsing helper routine. Returned structure is based on that used by the Search::QueryParser Perl module.
Definition at line 58 of file SubmissionSearch.inc.php.
References Application\getSubmissionSearchIndex(), and PKPString\strtolower().
Referenced by _parseQuery().
|
abstract |
See implementation of retrieveResults for a description of this function.
Note that this function is also called externally to fetch results for the title index, and possibly elsewhere.
| $results | array |
| $user | User optional (if availability information is desired) |
Reimplemented in MonographSearch.
Referenced by retrieveResults().
|
abstractprotected |
Return the default order direction.
| $orderBy | string |
Reimplemented in MonographSearch.
Referenced by getResultSetOrdering().
| SubmissionSearch::getResultSetOrdering | ( | $request | ) |
Return the currently selected result set ordering option (default: descending relevance).
| $request | Request |
Definition at line 318 of file SubmissionSearch.inc.php.
References getDefaultOrderDir(), getResultSetOrderingDirectionOptions(), and getResultSetOrderingOptions().
Referenced by retrieveResults().
| SubmissionSearch::getResultSetOrderingDirectionOptions | ( | ) |
Return the available options for the result set ordering direction.
Definition at line 303 of file SubmissionSearch.inc.php.
Referenced by getResultSetOrdering().
|
abstract |
Return the available options for result set ordering.
| $request | Request |
Reimplemented in MonographSearch.
Referenced by getResultSetOrdering().
|
abstractprotected |
Return the search DAO
Reimplemented in MonographSearch.
Referenced by _getMergedPhraseResults().
|
abstractprotected |
See implementation of retrieveResults for a description of this function.
Reimplemented in MonographSearch.
Referenced by retrieveResults().
| SubmissionSearch::retrieveResults | ( | $request, | |
| $context, | |||
| $keywords, | |||
| & | $error, | ||
$publishedFrom = null, |
|||
$publishedTo = null, |
|||
$rangeInfo = null, |
|||
$exclude = array() |
|||
| ) |
Return an array of search results matching the supplied keyword IDs in decreasing order of match quality. Keywords are supplied in an array of the following format: $keywords[SUBMISSION_SEARCH_AUTHOR] = array('John', 'Doe'); $keywords[SUBMISSION_SEARCH_...] = array(...); $keywords[null] = array('Matches', 'All', 'Fields');
| $request | Request |
| $context | object The context to search |
| $keywords | array List of keywords |
| $error | string a reference to a variable that will contain an error message if the search service produces an error. |
| $publishedFrom | object Search-from date |
| $publishedTo | object Search-to date |
| $rangeInfo | Information on the range of results to return |
| $exclude | array An array of article IDs to exclude from the result. |
Definition at line 231 of file SubmissionSearch.inc.php.
References _getMergedArray(), _parseQuery(), HookRegistry\call(), formatResults(), getResultSetOrdering(), and getSparseArray().