Is there an Iphone SDK API to search resource files?
I have a set of html file resources that I'd like the user to be able to search in, but I want to avoid reading the files into memory and searching them one by one.
Is there any API that can help me do this?
From stackoverflow
-
No, you'll have to read the files in to search them. There's nothing like "Spotlight" on the phone.
hhafez : The problem with that is i have a lot of html, about 5Mb I'm worried about the search performance. But I guess I'm just going to have to do it and see what the performance is likeAugust : I would argue that if you have that much data, you're better off using a SQLite database instead of flat files. Maybe even do some sort of content index in the database that's searchable along with a pointer to the actual HTML file.hhafez : I've been looking for an excuse to play with SQLite I thik I'll give a try -
I would suggest you using SQLite FTS3 extension for full text search through your documents. It has quite good capabilities for it. But you will need to strip HTML tags first so it can index only your text and don't bother with tags
0 comments:
Post a Comment