/** * Gets a plain text of an article using Solr. * * @return string The plain text as stored in solr. Will be empty if we don't have a result. */ public function getTextFromSolr() { $service = new SolrDocumentService(); // note that this will use wgArticleId without an article if ($this->article) { $service->setArticleId($this->article->getId()); } $htmlField = Wikia\Search\Utilities::field('html'); $document = $service->getResult(); $text = ''; if ($document !== null) { if (!empty($document[static::SOLR_SNIPPETS_FIELD])) { $text = $document[static::SOLR_SNIPPETS_FIELD]; } elseif (isset($document[$htmlField])) { $text = $document[$htmlField]; } } return $text; }
?> " <?php echo $trackingData; ?> ><?php echo $title; ?> </a> </h1> <p class="hub subtle"><?php echo strtoupper($result->getHub()); ?> </p> <p class="description"><?php echo $result->getText(Wikia\Search\Utilities::field('description'), $isOnWikiMatch ? 16 : 60); ?> </p> <ul class="wiki-statistics subtle"> <li><?php echo $pagesMsg; ?> </li> <li><?php echo $imgMsg; ?> </li> <li><?php echo $videoMsg; ?>
?> " <?php echo $trackingData; ?> ><?php echo $title; ?> </a> </h1> <p class="hub subtle"><?php echo strtoupper($result->getHub()); ?> </p> <p class="description"><?php echo $result->getText(Wikia\Search\Utilities::field('description'), 16); ?> </p> <ul class="wiki-statistics subtle"> <li><?php echo $pagesMsg; ?> </li> <li><?php echo $imgMsg; ?> </li> <li><?php echo $videoMsg; ?>