mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 15:05:50 +00:00
BUGFIX: Fixed search results turning empty titles. BUGFIX: fixed Zend_Lucene conflict with include paths
git-svn-id: http://svn.silverstripe.com/projects/ss2doc/branches/v2@118238 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c39809cfae
commit
df3466a010
@ -136,7 +136,12 @@ class DocumentationSearch {
|
||||
self::$enabled = true;
|
||||
|
||||
// include the zend search functionality
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(__FILE__)) . '/thirdparty/');
|
||||
set_include_path(
|
||||
dirname(dirname(__FILE__)) . '/thirdparty/'. PATH_SEPARATOR .
|
||||
get_include_path()
|
||||
);
|
||||
|
||||
require_once 'Zend/Search/Lucene.php';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,10 +169,9 @@ class DocumentationSearch {
|
||||
* Perform a search query on the index
|
||||
*/
|
||||
public function performSearch() {
|
||||
require_once 'Zend/Search/Lucene.php';
|
||||
|
||||
try {
|
||||
$index = Zend_Search_Lucene::open(self::get_index_location());
|
||||
|
||||
Zend_Search_Lucene::setResultSetLimit(200);
|
||||
|
||||
$this->results = $index->find($this->getQuery());
|
||||
|
@ -4,10 +4,15 @@
|
||||
|
||||
<% if Results %>
|
||||
<p>Showing page $ThisPage of $TotalPages</p>
|
||||
<% control Results %>
|
||||
<h3><a href="$Link">$BreadcrumbTitle</a></h3>
|
||||
<p>$Content.LimitCharacters(200)</p>
|
||||
<% end_control %>
|
||||
|
||||
<ul>
|
||||
<% control Results %>
|
||||
<li>
|
||||
<h3><a href="$Link"><% if BreadcrumbTitle %>$BreadcrumbTitle<% else %>$Title<% end_if %></a></h3>
|
||||
<p>$Content.LimitCharacters(200)</p>
|
||||
</li>
|
||||
<% end_control %>
|
||||
</ul>
|
||||
|
||||
<% if SearchPages %>
|
||||
<ul class="pagination">
|
||||
|
Loading…
x
Reference in New Issue
Block a user