Custom filter implementations must provide proper implementations of the #equals() and #hashCode() methods.

Description

The filters ChainedFilter, DistanceFilter and SpatialHashFilter does not have their own implementations of the #equals() and #hashCode() methods. A filter may be used as a key for the Lucene's QueryCache and this cache requires that all queries (a filter is a query) must provide proper implementations of the #equals() and #hashCode() methods. The absence of the implementations for this methods may lead to incorrect results of a query execution.

Btw. I think Hibernate Search should allow to configure different QueryCache and QueryCachingPolicy.

Environment

None

Status

Assignee

Andrej Golovnin

Reporter

Andrej Golovnin

Labels

None

Suitable for new contributors

Yes, likely

Feedback Requested

None

Components

Affects versions

5.7.0.Final

Priority

Major