objectbox-dart icon indicating copy to clipboard operation
objectbox-dart copied to clipboard

Support locale aware ordering (accents, etc.)

Open toshiossada opened this issue 3 years ago • 5 comments
trafficstars

I wanna a way to ignore diacritics when a search a data in object box?

for example I like to find users with name joe, jóe or joé

Query<User> query = userBox.query(
            User_.firstName.equal('joe')
        .build();
        
// or use operator overloads:
Query<User> query = userBox.query(User_.firstName.equal('Joe'))
        .build();

toshiossada avatar Nov 10 '22 23:11 toshiossada

Thanks for the suggestion. This is currently not possible, you would have to include all variants chained using an OR condition.

Edit: As a workaround, you could add another property that stores the original value with diacritics removed (and mapped to lower case) in whichever way fits your use case.

This was double posted on Stack Overflow, but as this is more a feature request, answering here.

There is a similar issue for the Java library about improving support for UTF-8 characters: https://github.com/objectbox/objectbox-java/issues/46

greenrobot-team avatar Nov 14 '22 09:11 greenrobot-team

Ok :(

toshiossada avatar Nov 22 '22 14:11 toshiossada

but it'd be usefull

toshiossada avatar Nov 22 '22 14:11 toshiossada

Has any plan to implement this feature?

toshiossada avatar Nov 30 '22 20:11 toshiossada

image if I enabled to use getter method was possible it will be usefull

toshiossada avatar Nov 30 '22 20:11 toshiossada