CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Job\LinksUpdate Class Reference

Performs the appropriate updates to Elasticsearch after a LinksUpdate is completed. More...

+ Inheritance diagram for CirrusSearch\Job\LinksUpdate:
+ Collaboration diagram for CirrusSearch\Job\LinksUpdate:

Public Member Functions

 __construct (Title $title, array $params)
 
 isPrioritized ()
 
- Public Member Functions inherited from CirrusSearch\Job\CirrusTitleJob
 __construct ( $title, $params)
 
 getSearchConfig ()
 

Static Public Member Functions

static newPageChangeUpdate (Title $title, ?RevisionRecord $revisionRecord, array $params)
 Prepare a page update for when this page is directly updated (new revision/delete/restore)
 
static newPastRevisionVisibilityChange (Title $title)
 Prepare a cautionary update of a page that had some of its revision's visibility changed.
 
static newPageRefreshUpdate (Title $title, array $params)
 Prepare a page update for when the rendered output of the page might have changed due to a change not directly related to this page (e.g.
 
static newSaneitizerUpdate (Title $title, ?string $cluster)
 New change emitted from the saneitizer.
 

Protected Member Functions

 doJob ()
 

Additional Inherited Members

- Public Attributes inherited from CirrusSearch\Job\CirrusTitleJob
const UPDATE_KIND = 'update_kind'
 
const ROOT_EVENT_TIME = 'root_event_time'
 
const PAGE_CHANGE = 'page_change'
 a change made to the page, new revision/delete/restore
 
const PAGE_REFRESH = 'page_refresh'
 a change that could possibly change the rendered output of the page
 
const VISIBILITY_CHANGE = "visibility_change"
 a change emitted when detecting a visibility change on a past revision theoretically not needed but is being triggered out of caution as generally visibility changes occur to hide harmful content.
 
const SANEITIZER = "saneitizer"
 Change issued from the saneitizer, either a fixup or a forced update.
 
const CLUSTER = 'cluster'
 param key to store the target elastic cluster
 

Detailed Description

Performs the appropriate updates to Elasticsearch after a LinksUpdate is completed.

The page itself is updated first then a second copy of this job is queued to update linked articles if any links change. The job can be 'prioritized' via the 'prioritize' parameter which will switch it to a different queue then the non-prioritized jobs. Prioritized jobs will never be deduplicated with non-prioritized jobs which is good because we can't control which job is removed during deduplication. In our case it'd only be ok to remove the non-prioritized version.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Member Function Documentation

◆ doJob()

CirrusSearch\Job\LinksUpdate::doJob ( )
protected
Returns
bool

◆ isPrioritized()

CirrusSearch\Job\LinksUpdate::isPrioritized ( )
Returns
bool Is this job prioritized?

◆ newPageChangeUpdate()

static CirrusSearch\Job\LinksUpdate::newPageChangeUpdate ( Title $title,
?RevisionRecord $revisionRecord,
array $params )
static

Prepare a page update for when this page is directly updated (new revision/delete/restore)

Parameters
Title$title
RevisionRecord | null$revisionRecord
array$params
Returns
LinksUpdate

◆ newPageRefreshUpdate()

static CirrusSearch\Job\LinksUpdate::newPageRefreshUpdate ( Title $title,
array $params )
static

Prepare a page update for when the rendered output of the page might have changed due to a change not directly related to this page (e.g.

template update).

Parameters
Title$title
array$params
Returns
LinksUpdate

◆ newPastRevisionVisibilityChange()

static CirrusSearch\Job\LinksUpdate::newPastRevisionVisibilityChange ( Title $title)
static

Prepare a cautionary update of a page that had some of its revision's visibility changed.

(Theoretically not required because old revisions should not be part of the index)

Parameters
Title$title
Returns
LinksUpdate

◆ newSaneitizerUpdate()

static CirrusSearch\Job\LinksUpdate::newSaneitizerUpdate ( Title $title,
?string $cluster )
static

New change emitted from the saneitizer.

Parameters
Title$title
string | null$clusteroptional target cluster, null for all clusters
Returns
LinksUpdate

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