Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
ArticleSearch Class Reference

Public Member Functions

_getMergedArray (&$journal, &$keywords, $publishedFrom, $publishedTo)
 
_getMergedKeywordResults (&$journal, &$keyword, $type, $publishedFrom, $publishedTo, $resultsPerKeyword, $resultCacheHours)
 
_getMergedPhraseResults (&$journal, &$phrase, $type, $publishedFrom, $publishedTo, $resultsPerKeyword, $resultCacheHours)
 
_getSparseArray (&$mergedResults)
 
 _parseQuery ($query)
 
 _parseQueryInternal ($signTokens, $tokens, &$pos, $total)
 
formatResults (&$results)
 
 getKeywordsFromSearchFilters ($searchFilters)
 
 getSearchFilters (&$request)
 
retrieveResults (&$journal, &$keywords, &$error, $publishedFrom=null, $publishedTo=null, $rangeInfo=null)
 

Detailed Description

Class for retrieving article search results.

See Also
ArticleSearchDAO

FIXME: NEAR; precedence w/o parens?; stemming; weighted counting

Definition at line 35 of file ArticleSearch.inc.php.

Member Function Documentation

& ArticleSearch::_getMergedArray ( $journal,
$keywords,
  $publishedFrom,
  $publishedTo 
)

See implementation of retrieveResults for a description of this function.

Definition at line 106 of file ArticleSearch.inc.php.

References _getMergedKeywordResults(), and Config\getVar().

Referenced by retrieveResults().

& ArticleSearch::_getMergedKeywordResults ( $journal,
$keyword,
  $type,
  $publishedFrom,
  $publishedTo,
  $resultsPerKeyword,
  $resultCacheHours 
)

Recursive helper for _getMergedArray.

Definition at line 129 of file ArticleSearch.inc.php.

References _getMergedPhraseResults().

Referenced by _getMergedArray(), and _getMergedPhraseResults().

& ArticleSearch::_getMergedPhraseResults ( $journal,
$phrase,
  $type,
  $publishedFrom,
  $publishedTo,
  $resultsPerKeyword,
  $resultCacheHours 
)

Recursive helper for _getMergedArray.

Definition at line 183 of file ArticleSearch.inc.php.

References _getMergedKeywordResults(), and DAORegistry\getDAO().

Referenced by _getMergedKeywordResults().

& ArticleSearch::_getSparseArray ( $mergedResults)

See implementation of retrieveResults for a description of this function.

Definition at line 216 of file ArticleSearch.inc.php.

Referenced by retrieveResults().

ArticleSearch::_parseQuery (   $query)

Parses a search query string. Supports +/-, AND/OR, parens

Parameters
$query
Returns
array of the form ('+' => <required>, '' => <optional>, '-' => excluded)

Definition at line 43 of file ArticleSearch.inc.php.

References _parseQueryInternal().

Referenced by retrieveResults().

ArticleSearch::_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 54 of file ArticleSearch.inc.php.

References String\strtolower().

Referenced by _parseQuery().

& ArticleSearch::formatResults ( $results)

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.

Returns
array An array with the articles, published articles, issue, journal, section and the issue availability.

Definition at line 322 of file ArticleSearch.inc.php.

References DAORegistry\getDAO(), IssueAction\subscribedDomain(), IssueAction\subscribedUser(), and IssueAction\subscriptionRequired().

Referenced by PubMedExportPlugin\executeCLI(), CrossRefExportPlugin\executeCLI(), NativeImportExportPlugin\executeCLI(), BrowseHandler\identifyTypes(), retrieveResults(), BrowseHandler\sections(), and SearchHandler\titles().

ArticleSearch::getKeywordsFromSearchFilters (   $searchFilters)

Load the keywords array from a given search filter.

Parameters
$searchFiltersarray Search filters as returned from ArticleSearch::getSearchFilters()
Returns
array Keyword array as required by ArticleSearch::retrieveResults()

Definition at line 297 of file ArticleSearch.inc.php.

Referenced by LuceneHandler\queryAutocomplete(), and SearchHandler\search().

ArticleSearch::getSearchFilters ( $request)

Retrieve the search filters from the request.

Parameters
$requestRequest
Returns
array All search filters (empty and active)

Definition at line 234 of file ArticleSearch.inc.php.

References DAORegistry\getDAO().

Referenced by LuceneHandler\queryAutocomplete(), and SearchHandler\search().

& ArticleSearch::retrieveResults ( $journal,
$keywords,
$error,
  $publishedFrom = null,
  $publishedTo = null,
  $rangeInfo = null 
)

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[ARTICLE_SEARCH_AUTHOR] = array('John', 'Doe'); $keywords[ARTICLE_SEARCH_...] = array(...); $keywords[null] = array('Matches', 'All', 'Fields');

Parameters
$journalobject The journal to search
$keywordsarray List of keywords
$errorstring a reference to a variable that will contain an error message if the search service produces an error.
$publishedFromobject Search-from date
$publishedToobject Search-to date
$rangeInfoInformation on the range of results to return
Returns
VirtualArrayIterator An iterator with one entry per retrieved article containing the article, published article, issue, journal, etc.

Definition at line 404 of file ArticleSearch.inc.php.

References _getMergedArray(), _getSparseArray(), _parseQuery(), HookRegistry\call(), and formatResults().

Referenced by SearchHandler\search().


The documentation for this class was generated from the following file: