ZF-6075: Range queries lead to Lucene Exception in ZF 1.7.7

Issue Type: Bug Created: 2009-03-20T08:55:15.000+0000 Last Updated: 2009-04-30T06:32:32.000+0000 Status: Resolved Fix version(s): Reporter: Dario Arruda (darruda) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: Attachments:


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. Apparently, for each date in the range, a term is created, leading to a situation of count($terms) > getTermsPerQueryLimit() .

Tried Zend_Search_Lucene::setTermsPerQueryLimit(0) but still doesn't work.


Posted by Alexander Veremyev (alexander) on 2009-04-30T06:32:31.000+0000

Due to performance considerations the limit of matching terms is set for range, wildcard and fuzzy queries.

This limit can be retrieved/set using Zend_Search_Lucene::getTermsPerQueryLimit()/Zend_Search_Lucene::setTermsPerQueryLimit($limit) methods.

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.