Hahaha That query was inspired by a dating app we built. But I would think that it would parse any legitimate query.
CCing to the list. -Matt On Fri, Feb 6, 2009 at 1:28 PM, Jurriƫn Stutterheim wrote: > Zend_Search_Lucene is probably not the best way to get a date.... > If I recall correctly the behaviour of the query parser changed in 1.5 to > not throw exceptions when parsing fails, unless it's told to do so. Try > adding > Zend_Search_Lucene_Search_QueryParser::dontSuppressQueryParsingExceptions(); > > > > On Feb 7, 2009, at 07:20 , Matthew Ratzloff wrote: > > I was under the impression that the QueryParser class parsed a query and, > if there were no exceptions, returned an object that, when converted to a > string, would return a working query. > > This seems to not be the case: > > ------------------------------------------------------------------ > #!/usr/bin/php > <?php > set_include_path('./ZendFramework/trunk/library'); > > require_once 'Zend/Loader.php'; > Zend_Loader::registerAutoload(); > > $queryString = '+gender:female age:[24 TO 30] +location:"Seattle, WA"'; > try { > $query = Zend_Search_Lucene_Search_QueryParser::parse($queryString); > } catch (Zend_Search_Lucene_Search_QueryParserException $e) { > echo "Query syntax error: " . $e->getMessage() . "\n"; > } > > print $query; > #=> gender female age to location seattle wa > ------------------------------------------------------------------ > > Any ideas? Or am I misunderstanding the purpose of the class? > > -Matt > > >