mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 23:42:11 +00:00
catch Lucene_Exeption if query is invalid
This commit is contained in:
parent
452aa8edea
commit
a177b8689f
|
@ -69,12 +69,16 @@ class SeedDMS_Lucene_Search {
|
|||
}
|
||||
try {
|
||||
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
||||
$hits = $this->index->find($query);
|
||||
$recs = array();
|
||||
foreach($hits as $hit) {
|
||||
$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->document_id);
|
||||
try {
|
||||
$hits = $this->index->find($query);
|
||||
$recs = array();
|
||||
foreach($hits as $hit) {
|
||||
$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->document_id);
|
||||
}
|
||||
return $recs;
|
||||
} catch (Zend_Search_Lucene_Exception $e) {
|
||||
return array();
|
||||
}
|
||||
return $recs;
|
||||
} catch (Zend_Search_Lucene_Search_QueryParserException $e) {
|
||||
return array();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user