Hi, I've been going nuts trying to use LuceneParser parse query strings using the default operator AND correctly:
String queryString = getQueryString(); QueryParser parser = new QueryParser("text", new StandardAnalyzer()); parser.setDefaultOperator(QueryParser.AND_OPERATOR); try { Query q = parser.parse(queryString); LOG.info("q: " + q.toString()); /* [...] */ Here's two example queries and the results I get with and without the `setDefaultOperator()' statetment: Query: hose AND cat:Wohnen cat:Mode OR color:blau - Default-Op OR: (+text:hose +cat:Wohnen) cat:Mode color:blau - Default-Op AND: +(+text:hose +cat:Wohnen) cat:Mode color:blau Query: hose AND ( cat:Wohnen cat:Mode ) OR color:blau - Default-Op OR: (+text:hose +(cat:Wohnen cat:Mode)) color:blau - Default-Op AND: (+text:hose +(+cat:Wohnen +cat:Mode)) color:blau It seems like theparser handles the default case well, but what I get with the default operator set to AND is completely incorrect. I've seen this behaviour with both version 2.1.0 and 2.2.0. Any hints? Cheers, Martin -- ----------- / http://herbert.the-little-red-haired-girl.org / ------------- =+= I got it good, I got it bad. I got the sweetest sadness I ever had. --- the The --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]