lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: RangeQuery doesn't override equals() or hashCode() - intentional?
Date Mon, 11 Apr 2005 12:51:53 GMT

On Apr 11, 2005, at 4:48 AM, Chris Lamprecht wrote:
> I was attempting to cache QueryFilters in a Map using the Query as the
> key (a BooleanQuery instance containing two RangeQueries), and I
> discovered that my BooleanQueries' equals() methods would always
> return false, even when the queries were equivalent.  The culprit was
> RangeQuery - it doesn't implement equals() or hashCode().  Is this
> intentional, and if not, can I propose a patch to implement these
> methods?  thanks,

I have been adding .equals/.hashCode to the query types as I find a 
need.  I'm comparing queries generated by a custom query parser and 
queries created by the API using .equals in unit tests and have 
encountered the same issue.  I have not hit RangeQuery yet, so your 
patch would be a welcome addition.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message