开发者

Zend Lucene displays blank screen when no results found

开发者 https://www.devze.com 2022-12-22 12:06 出处:网络
When I submit a query to Zend_Lucene with a string that exists in the index, the results are displayed as expected, however when string is not found, I get a blank page with no error messages. Code us

When I submit a query to Zend_Lucene with a string that exists in the index, the results are displayed as expected, however when string is not found, I get a blank page with no error messages. Code used as below:

require_once 'Zend/Feed.php';
require_once 'Zend/Search/Lucene.php';
$index = Zend_Search_Lucene::open('data/my-index');
$queryStr ='fjkhsdkdfh';
$hits = $index->find($queryStr);

if ($hits) {
    foreach ($hits as $hit) {   
        echo $hit->page_title;
    }
} else {
    echo 'No results found.';
}

I would expect 'No results found' to appear, but instead I get a blank page with no error messages.

What confuses me more is that I have this tested and working locally, but when on a live server it stops worki开发者_开发百科ng.

Locally I have Zend Server 4 installed, remotely PHP 5.2.11 and ZF 1.10.2

Any help much appreciated!

Paul


I actually found a work around to this that involved processing the entire routine through a single page. As I was calling in external functions to generate the querys for some reason a blank page was always returned. By placing all script on one page I was able to have results displayed.

0

精彩评论

暂无评论...
验证码 换一张
取 消