BUGFIX: resolved issues with missing search results by pulling in latest sapphiredocs

git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@120793 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2011-08-11 04:47:06 +00:00
parent cf51259592
commit 51394ea80d
2 changed files with 23 additions and 11 deletions

View File

@ -198,7 +198,7 @@ class DocumentationSearch {
$moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
foreach($this->modules as $module) {
$moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Module'));
$moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Entity'));
}
$query->addSubquery($moduleQuery, true);
@ -215,8 +215,9 @@ class DocumentationSearch {
}
$er = error_reporting();
error_reporting('E_ALL ^ E_NOTICE');
$this->results = $index->find($query);
error_reporting($er);
$this->totalResults = $index->numDocs();
@ -275,7 +276,7 @@ class DocumentationSearch {
'Link' => DBField::create('Varchar',$doc->getFieldValue('Link')),
'Language' => DBField::create('Varchar',$doc->getFieldValue('Language')),
'Version' => DBField::create('Varchar',$doc->getFieldValue('Version')),
'Module' => DBField::create('Varchar', $doc->getFieldValue('Module')),
'Entity' => DBField::create('Varchar', $doc->getFieldValue('Entity')),
'Content' => DBField::create('HTMLText', $content),
'Score' => $hit->score,
'Number' => $k + 1,
@ -372,7 +373,8 @@ class DocumentationSearch {
}
/**
* OpenSearch MetaData. Includes 'description', 'tags', 'contact'
* OpenSearch MetaData fields. For a list of fields consult
* {@link self::get_meta_data()}
*
* @param array
*/
@ -382,6 +384,9 @@ class DocumentationSearch {
self::$meta_data[strtolower($key)] = $value;
}
}
else {
user_error("set_meta_data must be passed an array", E_USER_ERROR);
}
}
/**
@ -392,12 +397,19 @@ class DocumentationSearch {
public static function get_meta_data() {
$data = self::$meta_data;
return array(
'Description' => (isset($data['description'])) ? $data['description'] : _t('DocumentationViewer.OPENSEARCHDESC', 'Search the documentation'),
'Tags' => (isset($data['tags'])) ? $data['tags'] : _t('DocumentationViewer.OPENSEARCHTAGS', 'documentation'),
'Contact' => (isset($data['contact'])) ? $data['contact'] : Email::getAdminEmail(),
'ShortName' => (isset($data['shortname'])) ? $data['shortname'] : _t('DocumentationViewer.OPENSEARCHNAME', 'Documentation Search')
$defaults = array(
'Description' => _t('DocumentationViewer.OPENSEARCHDESC', 'Search the documentation'),
'Tags' => _t('DocumentationViewer.OPENSEARCHTAGS', 'documentation'),
'Contact' => Email::getAdminEmail(),
'ShortName' => _t('DocumentationViewer.OPENSEARCHNAME', 'Documentation Search'),
'Author' => 'SilverStripe'
);
foreach($defaults as $key => $value) {
if(isset($data[$key])) $defaults[$key] = $data[$key];
}
return $defaults;
}
/**
@ -417,7 +429,7 @@ class DocumentationSearch {
// alter the fields for the opensearch xml.
$title = ($title = $this->getTitle()) ? ' - '. $title : "";
$link = Controller::join_links($this->outputController->Link(), 'DocumentationOpenSearch_Controller/description/');
$link = Controller::join_links($this->outputController->Link(), 'DocumentationOpenSearchController/description/');
$data->setField('Title', $data->Title . $title);
$data->setField('DescriptionURL', $link);

View File

@ -3,7 +3,7 @@
<title>$Title</title>
<link>$Link</link>
<author>
<name>SilverStripe Ltd.</name>
<name>$Author</name>
</author>
<updated>$Now</updated>