ZF-3321: Zend_Search_Lucene::find() times out on certain queries

Issue Type: Bug Created: 2008-05-24T16:37:46.000+0000 Last Updated: 2009-03-20T08:33:14.000+0000 Status: Resolved Fix version(s): - 1.7.7 (16/Mar/09)

Reporter: Ben Scholzen (dasprid) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: - ZF-5588



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.

<pre class="highlight">
$search = new Zend_Search_Lucene(...);

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.


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


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.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.