ZF-6156: $_minPrefixLength in Zend_Search_Lucene_Search_Query_Wildcard for ZF-3321breaks the search

Issue Type: Bug Created: 2009-03-30T02:15:14.000+0000 Last Updated: 2009-11-19T01:59:28.000+0000 Status: Resolved Fix version(s): Reporter: Symphony IT (symphony) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Search_Lucene

Related issues: Attachments:


the new $_minPrefixLength functionality added in to fix ZF-3321 may break many peoples searches with the default set to 3, I would think this should be changed to 0.

using :

$searchIndex = Zend_Search_Lucene::open($config->datafiles->directory . 'search-index'); Zend_Search_Lucene::setDefaultSearchField('title'); $filter = new Zend_Filter_Word_SeparatorToSeparator(' ','* '); $searchCriteria = $filter->filter($searchCriteria); $query = Zend_Search_Lucene_Search_QueryParser::parse(''.$searchCriteria.'*'); $searchResults = $searchIndex->find($query, 'title', SORT_STRING);

after upgrading to 1.7.7 all my search returned was "At least 3 non-wildcard terms are required." regardless of what anyone was searching for.

I had to add the following in above the call to the QueryParser to fix this issue:


The lack of documentation for this new functionality certainly didn't help


Posted by Benjamin Steininger (robo47) on 2009-04-04T04:51:31.000+0000

Setting it to 0 by default allows things like searches for * AND * AND * (and longer) which allows each user to easily let the script run for a long time and consume lots of memory until memory_limit or max_execution_time is reached.

I think security here should come first to not allow those things if the user not explicitly wants it.

Posted by Alexander Veremyev (alexander) on 2009-11-19T01:59:28.000+0000

This behavior is documented now.

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.