|
MediaWiki
master
|
Database independant search index updater. More...


Public Member Functions | |
| __construct ($id, $title, $c=false) | |
| Constructor. More... | |
| doUpdate () | |
| Perform actual update for the entry. More... | |
| updateText ($text, SearchEngine $se=null) | |
| Clean text for indexing. More... | |
Private Member Functions | |
| getLatestPage () | |
| Get WikiPage for the SearchUpdate $id using WikiPage::READ_LATEST and ensure using the same WikiPage object if there are multiple SearchEngine types. More... | |
| getNormalizedTitle (SearchEngine $search) | |
| Get a normalized string representation of a title suitable for including in a search index. More... | |
Private Attributes | |
| Content bool | $content |
| Content of the page (not text) More... | |
| int | $id = 0 |
| Page id being updated. More... | |
| WikiPage | $page |
| Title | $title |
| Title we're updating. More... | |
Database independant search index updater.
Definition at line 33 of file SearchUpdate.php.
| SearchUpdate::__construct | ( | $id, | |
| $title, | |||
$c = false |
|||
| ) |
Constructor.
| int | $id | Page id to update |
| Title | string | $title | Title of page to update |
| Content | string | bool | $c | Content of the page to update. Default: false. If a Content object, text will be gotten from it. String is for back-compat. Passing false tells the backend to just update the title, not the content |
Definition at line 55 of file SearchUpdate.php.
References $id, $title, content, Title\newFromText(), title, and wfDebug().
| SearchUpdate::doUpdate | ( | ) |
Perform actual update for the entry.
Implements DeferrableUpdate.
Definition at line 79 of file SearchUpdate.php.
References $id, $type, as, content, getLatestPage(), getNormalizedTitle(), title, and updateText().
Referenced by Maintenance\updateSearchIndexForPage().
|
private |
Get WikiPage for the SearchUpdate $id using WikiPage::READ_LATEST and ensure using the same WikiPage object if there are multiple SearchEngine types.
Returns null if a page has been deleted or is not found.
Definition at line 190 of file SearchUpdate.php.
References $page, WikiPage\newFromID(), page, and IDBAccessObject\READ_LATEST.
Referenced by doUpdate().
|
private |
Get a normalized string representation of a title suitable for including in a search index.
| SearchEngine | $search |
Definition at line 205 of file SearchUpdate.php.
References $t, $title, $wgContLang, global, SearchEngine\legalSearchChars(), SearchEngine\normalizeText(), NS_FILE, and title.
Referenced by doUpdate().
| SearchUpdate::updateText | ( | $text, | |
| SearchEngine | $se = null |
||
| ) |
Clean text for indexing.
Only really suitable for indexing in databases. If you're using a real search engine, you'll probably want to override this behavior and do something nicer with the original wikitext.
| string | $text | |
| SearchEngine | $se | Search engine |
Definition at line 122 of file SearchUpdate.php.
References $wgContLang, and global.
Referenced by doUpdate().
|
private |
Content of the page (not text)
Definition at line 41 of file SearchUpdate.php.
|
private |
Page id being updated.
Definition at line 35 of file SearchUpdate.php.
Referenced by __construct(), and doUpdate().
|
private |
Definition at line 44 of file SearchUpdate.php.
Referenced by getLatestPage().
|
private |
Title we're updating.
Definition at line 38 of file SearchUpdate.php.
Referenced by __construct(), and getNormalizedTitle().