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

Key: CMP-518
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Piotr ZieleziƄski
Votes: 0
Watchers: 0
Operations

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

Support for "normalization of the query string" in querryBuilder

Created: 28/Jan/08 08:30 AM   Updated: 15/Apr/08 03:29 PM
Component/s: Compass::Core
Affects Version/s: 2.0 M1
Fix Version/s: 2.0.0 RC2


 Description  « Hide
I've got a Category object with SearchableComponent Price which stores BigDecimal. I've specified the format of Bigdecimal to "#0000.00".

When I use queryString like this:
session.queryBuilder().queryString("amount:[10 TO 15]")
I receive +amount:[0010,00 TO 0015,00] and everything is ok, but
when I use:
session.queryBuilder().between("amount", new BigDecimal(10), new BigDecimal(60), true)
I receve: +amount:[10 TO 60] and no hits are returned.
If I specify:
session.queryBuilder().between("amount", "0010,00", "0060,00", true) it's ok.

I'm a bit misguided by the API because it specifies the Object as a parameter, but providing one does not have a correct effect.
Should I take care of formatting the object to correct string? If so shouldn't this method receive String parameters instead of Object?

The other solution is might be to provide additional boolean parameter which would trigger parsing of query as it is done in queryStirng method.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 15/Apr/08 03:27 PM
With current version of Compass, this will work if you specify the dot path notation to the amount. The fix, which I agree should be, is to not require the dot path notation, and do similar to what the behavior is with the query string.

Shay Banon added a comment - 15/Apr/08 03:29 PM
Fixed. In order to revert to the old behavior, CompassQueryBuilder#convertOnlyWithDotPath(true) should be set.