diff --git a/code/models/DocumentationPage.php b/code/models/DocumentationPage.php index 792f8ff..b5a20d2 100755 --- a/code/models/DocumentationPage.php +++ b/code/models/DocumentationPage.php @@ -148,12 +148,12 @@ class DocumentationPage extends ViewableData { /** * Returns the public accessible link for this page. * + * @param Boolean Absolute URL (incl. domain), or relative to webroot * @return string */ - function getLink() { + function getLink($absolute=true) { if($entity = $this->getEntity()) { - $link = Controller::join_links($entity->Link($this->getVersion(), $this->lang), $this->getRelativeLink()); - + $link = $this->getRelativeLink(); $link = rtrim(DocumentationService::trim_extension_off($link), '/'); // folders should have a / on them. Looks nicer @@ -166,7 +166,13 @@ class DocumentationPage extends ViewableData { $link = $this->getPath(true); } - return $link; + if($absolute) { + $fullLink = Controller::join_links($entity->Link($this->getVersion(), $this->lang), $link); + } else { + $fullLink = Controller::join_links($entity->getRelativeLink($this->getVersion(), $this->lang), $link); + } + + return $fullLink; } /** diff --git a/code/tasks/RebuildLuceneDocsIndex.php b/code/tasks/RebuildLuceneDocsIndex.php index bcf5698..6a84f57 100755 --- a/code/tasks/RebuildLuceneDocsIndex.php +++ b/code/tasks/RebuildLuceneDocsIndex.php @@ -86,7 +86,7 @@ class RebuildLuceneDocsIndex extends BuildTask { $doc->addField(Zend_Search_Lucene_Field::Keyword('Version', $page->getVersion())); $doc->addField(Zend_Search_Lucene_Field::Keyword('Language', $page->getLang())); $doc->addField(Zend_Search_Lucene_Field::Keyword('Entity', $entity)); - $doc->addField(Zend_Search_Lucene_Field::Keyword('Link', $page->Link)); + $doc->addField(Zend_Search_Lucene_Field::Keyword('Link', $page->getLink(false))); // custom boosts $titleField->boost = 3;