简体   繁体   中英

what is the best way to full text search in a large Array of String in android?

i have an large Array of String, say its length is about 30000, and also those string are fairly long (about 10 line of text). now my Question is what is best way to search in this array? someone told me to use FTS3, is it possible to search in arrays? or apache lucene?

i want and an advanced search.

I don't think you should hold 30.000 string of +/- 10 lines in memory. As CommonsWare told before this would put the heap under a lot of (unnecessary) preassure.

A few possabilities come to mind to store the strings and make them accessable for string comparison. You could store the string in a database and use full text search options. But you could also save tham in a file (for example a JSON file) and use a buffered stream in order to compare the strings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM