CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Interface for changing weighted tags. More...
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 |
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
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
.
ProperPageIdentity | $page | |
string[] | $tagPrefixes | |
'revision'|null | $trigger optionally indicate what triggered this update, this hint is currently only processed by EventBusWeightedTagsUpdater |
WeightedTagsException | if sending the event fails |
Implemented in CirrusSearch\EventBusWeightedTagsUpdater, and CirrusSearch\Updater.
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).
ProperPageIdentity | $page | |
string | $tagPrefix | A prefix shared by all $tagNames |
null | null[] | int[] | $tagWeights | Optional tag weights. A map of optional weights, keyed by tag name.
|
'revision'|null | $trigger Optional indicator what triggered this update, this hint is currently only processed by EventBusWeightedTagsUpdater |
WeightedTagsException | if sending the event fails |
Implemented in CirrusSearch\EventBusWeightedTagsUpdater, and CirrusSearch\Updater.