objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
1.05k stars 120 forks source link

Support locale aware ordering (accents, etc.) #484

Open toshiossada opened 2 years ago

toshiossada commented 2 years ago

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();
greenrobot-team commented 2 years ago

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

toshiossada commented 1 year ago

Ok :(

toshiossada commented 1 year ago

but it'd be usefull

toshiossada commented 1 year ago

Has any plan to implement this feature?

toshiossada commented 1 year ago

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