DEFAULT_CONTEXT_CHARS.
* SearchUpdate constructor: passing a string as the title param and or a boolean
or a string as the content will produce a deprecation warning.
+* SearchEngine::getTextFromContent() is deprecated, use getTextForSearchIndex()
+ directly from the Content object.
+* SearchEngine::textAlreadyUpdatedForIndex() is deprecated, given the
+ deprecation above this method is no longer needed/called and should not be
+ implemented by SearchEngine implementation.
=== Other changes in 1.34 ===
* …
continue;
}
- $text = $search->getTextFromContent( $this->title, $this->content );
- if ( !$search->textAlreadyUpdatedForIndex() ) {
- $text = $this->updateText( $text, $search );
- }
+ $text = $this->content !== null ? $this->content->getTextForSearchIndex() : '';
+ $text = $this->updateText( $text, $search );
# Perform the actual update
$search->update( $this->id, $normalTitle, $search->normalizeText( $text ) );
* @param Title $t Title we're indexing
* @param Content|null $c Content of the page to index
* @return string
+ * @deprecated since 1.34 use Content::getTextForSearchIndex directly
*/
public function getTextFromContent( Title $t, Content $c = null ) {
return $c ? $c->getTextForSearchIndex() : '';
* rather silly handling, it should return true here instead.
*
* @return bool
+ * @deprecated since 1.34 no longer needed since getTextFromContent is being deprecated
*/
public function textAlreadyUpdatedForIndex() {
return false;
protected function initText() {
if ( !isset( $this->mText ) ) {
if ( $this->mRevision != null ) {
- $this->mText = $this->searchEngine->getTextFromContent(
- $this->mTitle, $this->mRevision->getContent() );
+ $content = $this->mRevision->getContent();
+ $this->mText = $content !== null ? $content->getTextForSearchIndex() : '';
} else { // TODO: can we fetch raw wikitext for commons images?
$this->mText = '';
}