Manual:Hooks/CirrusSearchBuildDocumentParse

From MediaWiki.org
Jump to navigation Jump to search
CirrusSearchBuildDocumentParse
Available from version 1.23.0
Allows extensions to modify ElasticSearch document produced from a page
Define function:
public static function onCirrusSearchBuildDocumentParse( \Elastica\Document $doc, Title $title, Content $content, ParserOutput $parserOutput ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"CirrusSearchBuildDocumentParse": "MyExtensionHooks::onCirrusSearchBuildDocumentParse"
	}
}

For MediaWiki ≤1.25:

$wgHooks['CirrusSearchBuildDocumentParse'][] = 'MyExtensionHooks::onCirrusSearchBuildDocumentParse';
Called from:File(s): Updater.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:CirrusSearchBuildDocumentParse extensions.

This hook is a part of CirrusSearch extension .

Details[edit]

  • $doc - \Elastica\Document object representing the page. Extensions can modify it.
  • $title - Title object for the page being parsed.
  • $content - Content object for the page.
  • $parserOutput - ParserOutput for the page, if exists, or null.

See also[edit]