Databases for REAL
Full Text Queries with SQLite
Issue: 8.5 (July/August 2010)
Article Description: No description available.
Article Length (in bytes): 3,195
Starting Page Number: 62
RBD Number: 8510
Resource File(s): None
Related Web Link(s):
Known Limitations: None
Excerpt of article text...
One of the optional modules of SQLite is full text searching. Big deal, you say. Any database has full text searching. Just do "SELECT column FROM table WHERE column LIKE '%value%';" and you'll search the full text.
True, but this is not what we actually call a full text search and it doesn't always work the way you want it to. Let's look at this in more detail.
What is Full Text Search?
Although an SQL query using LIKE can search your text columns, it's not really a full text search. Think of a full text search as more like the results you get when you search with Google; there is some intelligence behind it.
Let's look at a few examples with a sample table:
CREATE TABLE Book (ID INTEGER PRIMARY KEY, Title TEXT);
INSERT INTO Book (Title) VALUES ('Ramblings on REALbasic');
INSERT INTO Book (Title) VALUES ('The Real Easy Way to Cook');
INSERT INTO Book (Title) VALUES ('Bling: The Story of Excess');
This query searches for 'real' using LIKE:
SELECT Title FROM Book WHERE Title LIKE '%real%';
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.