This issue is only relevant when using Compass internal ids for searching, dotted syntax. Eg: Alias.component.property:value.
When more than one object instance is referenced in an object graph, compass will only index it once. That means that if you want to search using the dotted notation, you might not get the results you expect. An example:
Given a class Client, with component ZipCode and component Property, and that class Property also has a component ZipCode. If the client references the same ZipCode instance as its property, then you are not able to search for Client.property.zipCode, because Compass will only index the id when it hits the zip code the second time around. The attached patch does not cache object instances, and therefore fixes this problem. Could there be a configuration option to allow this behaviour?
See discussion in this forum thread: http://forum.compass-project.org/thread.jspa?messageID=295983&tstart=0
I thought about this a bit, and it actually make sense to have this behavior the default one. There is a global setting called compass.osem.filterDuplicates. The default value is false, but it can be set to true to revert back to the old behavior. Filtering duplicates can also be done on a class mapping level.