Zend Framework

single character with wildcars search

Details

Description

Hello, i integrate zend lucene in my symfony application and i try to searching word...
i have see that if i try to search a single character whith a wilcards (for example: a*) zend search lucene broke...
I try to understand if this is only my problem or if is a zend_search_lucene problem, and i've try on your zend framework site: http://framework.zend.com/

if you search "a*" the result is a blank page....
http://framework.zend.com/search?query=a*&language=en&type=all&x=17&y=19

in a devzone too:
http://devzone.zend.com/search/results?q=a*

Activity

Hide
Shaun Farrell added a comment - - edited

This is because default behavior of Zend_Search_Lucene throws an exception if you search with wildcard character not followed by 3 non wild card characters.

You should catch this exception and handle it.

Example:

// Fail
$results = $index->find("a*"); //At least 3 non-wildcard characters are required at the beginning of pattern.

//Fail
$results = $index->find("aa*"); //At least 3 non-wildcard characters are required at the beginning of pattern.

//SUCCESS
$results = $index->find("aaa*");
Show
Shaun Farrell added a comment - - edited This is because default behavior of Zend_Search_Lucene throws an exception if you search with wildcard character not followed by 3 non wild card characters. You should catch this exception and handle it. Example:
// Fail
$results = $index->find("a*"); //At least 3 non-wildcard characters are required at the beginning of pattern.

//Fail
$results = $index->find("aa*"); //At least 3 non-wildcard characters are required at the beginning of pattern.

//SUCCESS
$results = $index->find("aaa*");
Hide
Shaun Farrell added a comment -

Works as designed. Exception is thrown due to 3 non wildcard characters before wildcard.

Show
Shaun Farrell added a comment - Works as designed. Exception is thrown due to 3 non wildcard characters before wildcard.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: