mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +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 {
|
try {
|
||||||
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
$query = Zend_Search_Lucene_Search_QueryParser::parse($querystr);
|
||||||
$hits = $this->index->find($query);
|
try {
|
||||||
$recs = array();
|
$hits = $this->index->find($query);
|
||||||
foreach($hits as $hit) {
|
$recs = array();
|
||||||
$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->document_id);
|
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) {
|
} catch (Zend_Search_Lucene_Search_QueryParserException $e) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user