output: Narrow Title type hint to LinkTarget
[lhc/web/wiklou.git] / includes / deferred / SearchUpdate.php
index f37e9a5..a508746 100644 (file)
@@ -40,7 +40,7 @@ class SearchUpdate implements DeferrableUpdate {
        /** @var Content|null Content of the page (not text) */
        private $content;
 
-       /** @var WikiPage **/
+       /** @var WikiPage */
        private $page;
 
        /**
@@ -99,10 +99,8 @@ class SearchUpdate implements DeferrableUpdate {
                                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 ) );