Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS contact search app
    primarykey
    data
    text
    <p>I am developing an app similar to iOS contact app . In my app it would be around 20000 contacts in the list . I would like to perform universal search in this app. Also the search should happen as we type in the search field </p> <p>, Searching "John Australia" will bring the contact where John is in the first name field and Australia in the address field . I used coredata but its performance is very poor (I dont know may be I am using not proper predicates, I used a predicate with combination of OR and AND). </p> <p>So now I moved to sqlite FTS4 data base and using FMDB to search the contacts .Performance is much better than core data .</p> <p>Here is what I did with FTS4</p> <p>imported all contacts to coredata file (uniqID,name,age,email,company,title,address,note,). Now created a fts4 virtual table with uniqID ,searchText,displayName</p> <pre><code>create virtual table searchData using FTS4 (guid, searchText, displayName) </code></pre> <p>And inserted all fields to fts4 table. ie , eg , </p> <pre><code>uniqId name age email company title address note 12312 , John,32,johnsock@style.com , style Inc, CEO , Australia Street-4 , bla bla bla </code></pre> <p>This the row in core data and it is moved to FTS4 table like this </p> <pre><code> uniqID searchText displayName 12312 John John 12312 johnsock@style.com John 12312 Style Inc John 12312 CEO John 12312 Australia Street-4 John 12312 bla bla bla John </code></pre> <p>Now I am performing search in this sqlite fts 4 table . This is my SQL query for "John Australia"</p> <pre><code>SELECT guid,displayName FROM searchData WHERE searchText MATCH John* INTERSECT SELECT guid,displayName FROM searchData WHERE searchText MATCH Australia* </code></pre> <p>If I have 3 words then I will have intersection 3 select query . The output I am getting from this query is working perfectly .</p> <p>Once I getting result from the query I used the display name to populate in tableview </p> <p>I have 2 problems .</p> <p>1 still I am facing performance issue while comparing to iOS native contact app if I have multiple word.</p> <ol> <li><p>If I am searching only one word the performance is very good , but not satisfied with multiword search.</p></li> <li><p>My query wont search email id with like (that is I need to get result even if I search with the work "sock").</p></li> </ol> <p>Is there any algorithm or logic that I could apply in this search ,so that my searching is fast (please consider the multiword search). Also the same time how could I search email id with like query keeping the same better performance </p> <p>Reference :<a href="http://www.sqlite.org/fts3.html" rel="nofollow">http://www.sqlite.org/fts3.html</a></p> <p><a href="http://www.swwritings.com/post/2013-04-30-searching-for-speedy-searching" rel="nofollow">http://www.swwritings.com/post/2013-04-30-searching-for-speedy-searching</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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