Main Contents

Making a full text search on the iPhone

iphone

I found a GOOD article about full text search on http://vafer.org/blog/20090107014544. The author describes there a way to port lucene on the iphone and how to use sqlites built in feature for text search on the iPhone. Both ways seemed to be a little bit to complex for my problem. The Lucene port seems not be very stable and the sqlite approach needed an own compiled sqlite lib added to your own project which could be refused by apple.

My approach is very easy. Just use standard sqlite and like.

A statement will look then like: SELECT * FROM table WHERE hackstack like ‘%needle%’;

Because like is case insensitive it fits my needs quite good. Of course no stemming, but that is okay for me.

jazzanowak @ May 29, 2009

3 Comments

  1. Olivia August 15, 2009 @ 23:26

    Hi,
    Thanks for posting this. I’m on a search for tutorials and information about how to implement the full text search in my app. Do you have a real time example of this in action?

  2. jazzanowak August 16, 2009 @ 13:24

    I am currently working on my first iphone application, but in spare time, so it needs a lot of time. To be honest currently i am enjoying the beautiful weather in berlin this summer. I can send you some sample code for using sqlite, that is all you need, afterwards you only have to send selects to the database with like as where clause.

    Best Regards

    Daniel

  3. Olivia August 21, 2009 @ 20:56

    Daniel, not a problem. I appreciate your offer. If and when you have time, I would love to see any sample code. You can e-mail me at olivia71783@yahoo.com Thanks a lot.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Feed