Best searching library for mobile database

Viewed 90

Currently, I am working on an android project with a huge data set that has over 1 million of entries. Something like below:

data class Point(var address: String, var location: Location)

I need to implement searching methods to search all over the entries' addresses. I tried to convert data set to objectbox database. However, the searching performance is not really so good as I expected although I indexed the address field. It took about 10s for each search query. Here's how I did query with objectBox:

val list = ObjectBox.box.query()
            .contains(Point_.address, keyword)
            .build()

Do you have any suggestions on how to do a better performance search? Or perhaps a different search engine?

1 Answers

By default String queries in ObjectBox ignore case. If an index is used, it's better to use a case-sensitive query. This should perform magnitudes better. E.g.:

val list = ObjectBox.box.query()
            .contains(Point_.address, keyword, StringOrder.CASE_SENSITIVE)
            .build()
Related