lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Query.toString() and QueryParser.parse()
Date Wed, 22 Aug 2007 10:49:32 GMT

On Aug 22, 2007, at 6:34 AM, loesh wrote:
> Query parsed = qp.parse(queryString);
> String parsedString = parsed.toString();
> boolean equals = parsedString().equals(queryString);
> Maybe not the clearest of questions. but should "equals" in the  
> above example allways be true for any Query?

No, that never has been a design goal of Query.toString(), and there  
many cases that it fails.  QueryParser only supports a fraction of  
the Query subclasses out there, so any Query subclass it does not  
support, of course, will fail to parse as you're expecting.

I understand the benefit such a feature would have, though.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message