ZF-3321: Zend_Search_Lucene::find() times out on certain queries
Description
When doing a search like the following, Zend_Search_Lucene times out (on my server I have a script timeout of 60 seconds, so I guess it is not related to the mass of results, also since I only have about 100 results there.
$search = new Zend_Search_Lucene(...);
$search->find('*');
Also searches like ``` result in a timeout.
You can test this bug as well with the Manual Search of the Zend Framework. As this cannot be catched as Exception or such, it is really bad for production sites and should be fixed with the next mini release.
Comments
Posted by Wil Sinclair (wil) on 2008-06-01T15:58:38.000+0000
Alex, please evaluate and categorize as necessary. I'm taking a stab at release targeting based on Ben's comments, but you can change this if you think it's not right.
Posted by Dino Knoll (dinok) on 2008-07-16T13:09:07.000+0000
I think this is really necessary and important. Just think of what might happen, if somebody knows that you are using Zend_Search_Lucene. It's easy to kill the server with a flood of requests with invalid queries. Currently I plan to write some QueryFilters for the production server. But a good solution would be fine.
Posted by Nils Caspar (pencil) on 2008-10-25T08:21:02.000+0000
Any news?
Posted by Mateusz Kotiuk (kotek) on 2008-11-07T00:37:17.000+0000
How it's going ?
Posted by removed user (sandstrom) on 2008-12-01T12:14:45.000+0000
Would also very much like to see this bug resolved. Wish I knew enough to be able to contribute myself.
Anyone know the status on this one?
Posted by Mark (skyblaze) on 2009-01-20T06:54:22.000+0000
i Also have this important bug in a production site. I discovered it a few days ago. I have only a few records in the index but if i do a search with "*" php goes in timeout . I'm running zend framework 1.7
Posted by Mark (skyblaze) on 2009-01-23T03:04:33.000+0000
is it possibile to know if and when the problem will be resolved? We use this library in production sites so this is very very critial and important thank you.
Posted by Micha? Zieli?ski (zielun) on 2009-03-04T01:05:57.000+0000
I`m also in similar situation. Any clues when Alexander Veremyev will be able to fix it?
Posted by Alexander Veremyev (alexander) on 2009-03-13T11:10:54.000+0000
Fixed.
Fix is included into ZF 1.7.7 even it adds sevral methods into API. Documentation will be added with ZF 1.8.0
Posted by Dario Arruda (darruda) on 2009-03-20T08:27:41.000+0000
Hi all. I updated today to the latest version (1.7.7) and found what I think is a bug: querying the index with a range term, produces an error:
"Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Terms per query limit is reached.' in .../Zend/Search/Lucene/Search/Query/Range.php:191 Stack trace: #0 .../Zend/Search/Lucene/Search/Query/Boolean.php(145): "
Code: $userQuery = Zend_Search_Lucene_Search_QueryParser::parse(convertSpecialCharacters($query)); $datesLimit = Zend_Search_Lucene_Search_QueryParser::parse(date:[20010101 TO 20090303]); $query = new Zend_Search_Lucene_Search_Query_Boolean();
$query->addSubquery($datesLimit, true /* required /); $query->addSubquery($userQuery, true / required */);
$index = Zend_Search_Lucene::open($this->LuceneIndexLocation); $hits = $index->find($query);
Note: if the time frame between the dates is small (less than 1 year, for example) it works fine.
Tried Zend_Search_Lucene::setTermsPerQueryLimit(0) but still doesn't work.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-03-20T08:33:13.000+0000
Dario, please add a new issue for that.