Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
ArticleSearchIndex Class Reference

Public Member Functions

 _indexObjectKeywords ($objectId, $text, &$position)
 
_loadStopwords ()
 
 _updateTextIndex ($articleId, $type, $text, $assocId=null)
 
 articleChangesFinished ()
 
 articleDeleted ($articleId)
 
 articleFileChanged ($articleId, $type, $fileId)
 
 articleFileDeleted ($articleId, $type=null, $assocId=null)
 
 articleFilesChanged (&$article)
 
 articleMetadataChanged (&$article)
 
filterKeywords ($text, $allowWildcards=false)
 
 rebuildIndex ($log=false, $journal=null)
 
 suppFileMetadataChanged (&$suppFile)
 

Detailed Description

Class to maintain the article search index.

Definition at line 25 of file ArticleSearchIndex.inc.php.

Member Function Documentation

ArticleSearchIndex::_indexObjectKeywords (   $objectId,
  $text,
$position 
)

Index a block of text for an object.

Parameters
$objectIdint
$textstring
$positionint

Definition at line 369 of file ArticleSearchIndex.inc.php.

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

Referenced by _updateTextIndex(), and articleFileChanged().

& ArticleSearchIndex::_loadStopwords ( )

Return list of stopwords. FIXME: Should this be locale-specific?

Returns
array with stopwords as keys

Definition at line 398 of file ArticleSearchIndex.inc.php.

Referenced by filterKeywords().

ArticleSearchIndex::_updateTextIndex (   $articleId,
  $type,
  $text,
  $assocId = null 
)

Add a block of text to the search index.

Parameters
$articleIdint
$typeint
$textstring
$assocIdint optional

Definition at line 386 of file ArticleSearchIndex.inc.php.

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

Referenced by articleMetadataChanged(), and suppFileMetadataChanged().

ArticleSearchIndex::articleChangesFinished ( )

Let the indexing back-end know that the current transaction finished so that the index can be batch-updated.

Definition at line 254 of file ArticleSearchIndex.inc.php.

References HookRegistry\call().

ArticleSearchIndex::articleDeleted (   $articleId)

Signal to the indexing back-end that the metadata of a supplementary file changed.

See Also
ArticleSearchIndex::articleMetadataChanged() above for more comments.
Parameters
$articleIdinteger

Definition at line 238 of file ArticleSearchIndex.inc.php.

References HookRegistry\call().

ArticleSearchIndex::articleFileChanged (   $articleId,
  $type,
  $fileId 
)

Signal to the indexing back-end that an article file changed.

See Also
ArticleSearchIndex::articleMetadataChanged() above for more comments.
Parameters
$articleIdint
$typeint
$fileIdint

Definition at line 93 of file ArticleSearchIndex.inc.php.

References _indexObjectKeywords(), HookRegistry\call(), SearchFileParser\fromFile(), and DAORegistry\getDAO().

Referenced by articleFilesChanged().

ArticleSearchIndex::articleFileDeleted (   $articleId,
  $type = null,
  $assocId = null 
)

Signal to the indexing back-end that a file was deleted.

See Also
ArticleSearchIndex::articleMetadataChanged() above for more comments.
Parameters
$articleIdint
$typeint optional
$assocIdint optional

Definition at line 177 of file ArticleSearchIndex.inc.php.

References HookRegistry\call(), and DAORegistry\getDAO().

ArticleSearchIndex::articleFilesChanged ( $article)

Signal to the indexing back-end that all files (supplementary and galley) assigned to an article changed and must be re-indexed.

See Also
ArticleSearchIndex::articleMetadataChanged() above for more comments.
Parameters
$articleArticle

Definition at line 135 of file ArticleSearchIndex.inc.php.

References articleFileChanged(), HookRegistry\call(), DAORegistry\getDAO(), and suppFileMetadataChanged().

Referenced by rebuildIndex().

ArticleSearchIndex::articleMetadataChanged ( $article)

Signal to the indexing back-end that the metadata of an article changed.

Push indexing implementations will try to immediately update the index to reflect the changes. Pull implementations will mark articles as "changed" and let the indexing back-end decide the best point in time to actually index the changed data.

See Also
http://pkp.sfu.ca/wiki/index.php/OJSdeSearchConcept#Push_vs._Pull for a discussion of push vs. pull indexing.
Parameters
$articleArticle

Definition at line 41 of file ArticleSearchIndex.inc.php.

References _updateTextIndex(), and HookRegistry\call().

Referenced by rebuildIndex().

& ArticleSearchIndex::filterKeywords (   $text,
  $allowWildcards = false 
)

Split a string into a clean array of keywords

Parameters
$textstring
$allowWildcardsboolean
Returns
array of keywords

Definition at line 271 of file ArticleSearchIndex.inc.php.

References _loadStopwords(), Core\cleanVar(), Config\getVar(), String\regexp_replace(), String\regexp_split(), String\strlen(), String\strtolower(), and String\substr().

Referenced by _indexObjectKeywords().

ArticleSearchIndex::rebuildIndex (   $log = false,
  $journal = null 
)

Rebuild the search index for one or all journals.

Parameters
$logboolean Whether to display status information to stdout.
$journalJournal If given the user wishes to re-index only one journal. Not all search implementations may be able to do so. Most notably: The default SQL implementation does not support journal-specific re-indexing as index data is not partitioned by journal.

Definition at line 311 of file ArticleSearchIndex.inc.php.

References articleFilesChanged(), articleMetadataChanged(), HookRegistry\call(), and DAORegistry\getDAO().

ArticleSearchIndex::suppFileMetadataChanged ( $suppFile)

Signal to the indexing back-end that the metadata of a supplementary file changed.

See Also
ArticleSearchIndex::articleMetadataChanged() above for more comments.
Parameters
$suppFileobject

Definition at line 201 of file ArticleSearchIndex.inc.php.

References _updateTextIndex(), and HookRegistry\call().

Referenced by articleFilesChanged().


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