return $this->mImage;
}
- /**
- * @return float|null If not supported
- */
- function getScore() {
- return null;
- }
-
/**
* Lazy initialization of article text from DB
*/
// TODO: make highliter take a content object. Make ContentHandler a factory for SearchHighliter.
list( $contextlines, $contextchars ) = SearchEngine::userHighlightPrefs();
+
$h = new SearchHighlighter();
- if ( $wgAdvancedSearchHighlighting ) {
- return $h->highlightText( $this->mText, $terms, $contextlines, $contextchars );
+ if ( count( $terms ) > 0 ) {
+ if ( $wgAdvancedSearchHighlighting ) {
+ return $h->highlightText( $this->mText, $terms, $contextlines, $contextchars );
+ } else {
+ return $h->highlightSimple( $this->mText, $terms, $contextlines, $contextchars );
+ }
} else {
- return $h->highlightSimple( $this->mText, $terms, $contextlines, $contextchars );
+ return $h->highlightNone( $this->mText, $contextlines, $contextchars );
}
}