SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-652
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Shay Banon
Reporter: Ben Dotte
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Compass

Option to exclude all unmapped properties from the "all" property

Created: 12/Jun/08 01:32 PM   Updated: 14/Jul/08 02:44 PM
Component/s: Compass::Core
Affects Version/s: 2.0.0 GA
Fix Version/s: 2.1.0 M2

File Attachments: 1. Text File CompassAllUnmappedProperties.patch (3 kB)



 Description  « Hide
Right now any unmapped properties automatically get indexed onto the "all" property. This can become a problem for programmatically-generated properties that need to be excluded from "all" for permissioning purposes. Please add an option to exclude all unmapped properties from the "all" property. With this option enabled, programmatically-generated properties can still be searched on by manually adding them to the query.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ben Dotte added a comment - 11/Jul/08 01:05 PM
We need this feature for an upcoming release so I took a stab at implementing it and attached a patch that seems to do the job. It looks like the logic was already there, just a matter of adding the setting and updating the schema.

Shay Banon added a comment - 13/Jul/08 12:58 PM
Applied the patch. The patch was partial, as it was not setting the actual property (which I added in the ResolveLate... class).

So now, the sum up, including unmapped properties in all can be controlled by the following setting: compass.property.all.includeUnmappedProperties. The default is true.

It can also be controlled on a class/resource/xml/json mapping within the all mapping.

Can you please check and verify that things work? I am closing the issue for now, if something is wrong, I will reopen it.


Ben Dotte added a comment - 14/Jul/08 11:36 AM
Thanks for applying the patch. I re-tested it and it works except the property is defaulting to false instead of true. It works fine if I explicitly set it to true or false.

I had original changed the property to a Boolean and added the ResolveLate code but hit an NPE since ResolveLate wasn't setting the value soon enough (I think). So I put it back to private boolean includePropertiesWithNoMappings = true and removed the ResolveLate stuff and then it worked, but maybe that is wrong if the property is set in a different way from the way we are doing it (in compass.cfg.xml).


Shay Banon added a comment - 14/Jul/08 02:07 PM
Its strange that you say the property default to false, in the resolve late the default to true. The NPE happens in some of the tests since not all of them go through the resolve late processor (lower level ones). It should have been set in them explicitly.

Ben Dotte added a comment - 14/Jul/08 02:44 PM
Yes, the property is defaulting to false within our application running on the latest code from trunk (not in a unit test). It defaults to true using only the code from my patch. Maybe the resolve late stuff isn't initializing the value soon enough?

The NPE does not currently happen, I was saying it did happen in the code I was writing when I was trying to implement the ResolveLate section, but I backed that out.