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

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.

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.

Any news?

How it's going ?

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?

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

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.

I`m also in similar situation. Any clues when Alexander Veremyev will be able to fix it?

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

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.

Dario, please add a new issue for that.