CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\WeightedTagsUpdater Interface Reference

Interface for changing weighted tags. More...

+ Inheritance diagram for CirrusSearch\WeightedTagsUpdater:

Public Member Functions

 updateWeightedTags (ProperPageIdentity $page, string $tagPrefix, ?array $tagWeights=null, ?string $trigger=null)
 Request the setting of the WeightedTagsHooks::FIELD_NAME field for the given tag(s) and weight(s).
 
 resetWeightedTags (ProperPageIdentity $page, array $tagPrefixes, ?string $trigger=null)
 Request the reset of the WeightedTagsHooks::FIELD_NAME field for all tags prefixed with any of the $tagPrefixes.
 

Public Attributes

const SERVICE = self::class
 

Detailed Description

Interface for changing weighted tags.

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

◆ resetWeightedTags()

CirrusSearch\WeightedTagsUpdater::resetWeightedTags ( ProperPageIdentity $page,
array $tagPrefixes,
?string $trigger = null )

Request the reset of the WeightedTagsHooks::FIELD_NAME field for all tags prefixed with any of the $tagPrefixes.

Parameters
ProperPageIdentity$page
string[]$tagPrefixes
'revision'|null$trigger optionally indicate what triggered this update, this hint is currently only processed by EventBusWeightedTagsUpdater
Exceptions
WeightedTagsExceptionif sending the event fails
See also
WeightedTagsBuilder for parameter details

Implemented in CirrusSearch\EventBusWeightedTagsUpdater, and CirrusSearch\Updater.

◆ updateWeightedTags()

CirrusSearch\WeightedTagsUpdater::updateWeightedTags ( ProperPageIdentity $page,
string $tagPrefix,
?array $tagWeights = null,
?string $trigger = null )

Request the setting of the WeightedTagsHooks::FIELD_NAME field for the given tag(s) and weight(s).

Will set a $tagPrefix/$tagName|$tagWeight tag for each element of $tagNames, and will unset all other tags with the same prefix (in other words, this will replace the existing tag set for a given prefix).

Parameters
ProperPageIdentity$page
string$tagPrefixA prefix shared by all $tagNames
null | null[] | int[]$tagWeightsOptional tag weights. A map of optional weights, keyed by tag name.
  • Omit for tags which are fully defined by their prefix.
  • A single weight ranges between 1-1000.
'revision'|null$trigger Optional indicator what triggered this update, this hint is currently only processed by EventBusWeightedTagsUpdater
Exceptions
WeightedTagsExceptionif sending the event fails
See also
MultiListBuilder for parameter details

Implemented in CirrusSearch\EventBusWeightedTagsUpdater, and CirrusSearch\Updater.


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