[ https://issues.apache.org/jira/browse/LUCENE-2945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001331#comment-13001331 ]
Paul Elschot edited comment on LUCENE-2945 at 3/2/11 8:21 AM: -------------------------------------------------------------- A quick fix would be to implement hashCode() and equals() in SrndQuery, the basis of the class hierarchy in surround.query, by using the actual class of the object and by delegating to toString(). This will work because I implemented toString() all over this class hierarchy to verify the parsing results during development. For use in a query results cache, this might be somewhat too restrictive because there is no need to distinguish between the infix and prefix forms. Anyway, issue would be the same for an implementation of equals() and hashCode() all over the class hierarchy. was (Author: paul.elsc...@xs4all.nl): A quick fix would be to implement hashCode() and equals() in SrndQuery, the basis of the class hierarchy in surround.query, by using the actual class of the object and by delegating to toString(). This will work because I implemented toString() all over the this class hierarchy to verify the parsing results during development. For use in a query results cache, this might be somewhat too restrictive because there is no need to distinguish between the infix and prefix forms. Anyway, issue would be the same for an implementation of equals() and hashCode() all over the class hierarchy. > Surround Query doesn't properly handle equals/hashcode > ------------------------------------------------------ > > Key: LUCENE-2945 > URL: https://issues.apache.org/jira/browse/LUCENE-2945 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 3.0.3, 4.0 > Reporter: Grant Ingersoll > Priority: Minor > Attachments: LUCENE-2945-partial1.patch > > > In looking at using the surround queries with Solr, I am hitting issues > caused by collisions due to equals/hashcode not being implemented on the > anonymous inner classes that are created by things like DistanceQuery (branch > 3.x, near line 76) -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org