Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After researching a bit more I have found that <a href="http://en.wikipedia.org/wiki/Suffix_array" rel="nofollow noreferrer">Suffix Arrays</a> could get you the fasted answers. Also have a look at the Wikipedia entry for <a href="http://en.wikipedia.org/wiki/Suffix_tree" rel="nofollow noreferrer">Suffix Trees</a> for a bit more of an in depth explanation.<br> Besdies that I agree with the <a href="https://stackoverflow.com/questions/2139410/efficiently-filter-an-arraylist-in-java-android/2139444#2139444">answer above</a> that you could probably use an SQL Database for such queries. Doing an Sql Query against the data is probably one of the fastest ways to get what you want without suffix arrays.<br> One thing to speed things up a little without doing SQL would be to put firstName, middleName, lastName into one lowercase string, and put that into a new Map that is referencing the Array index. That way you can reduce search to just 10.000 strings of the hashmap without having to do a lowercase every time. It might be a bit faster but of course require more memory. Maybe try to do something with regular expressions to speed up the matching.<br> Another option would be to really create a searchindex with something like <a href="http://lucene.apache.org/java/docs/" rel="nofollow noreferrer">Lucene</a> even though I think that would be really overkill on an Android device but could work in plain Java and infix search in Lucene isn't super high performance either.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload