Re: need to implement full text search
- From: "Ralf Junker - http://www.yunqa.de/delphi/" <delphi@xxxxxxxxxxxx>
- Date: Fri, 14 Sep 2007 14:18:13 +0200
These are some of the advantages of SQLite's full text search (FTS) over your
approach:
1. You can simplify your database structure:
You can put all keywords into a single record. You will no longer have to take
care of referential integrity. The FTS index is updated automatically each time
you insert or change records in the FTS table, you do not have to worry about
this at all.
2. FTS supports advanced search queries:
You can OR terms (apples OR pears), exclude terms (apples -pears), perform
phrase searches ("apples mixed with pears"), and prefix searches (apple*), which
will find apple as well as apples.
3. Combine FTS with other SQL
SQLite FTS allows to integrate full text search queries into ordinary SQL. This
allows to filter objects by date, or other properties, just by writing a new SQL
query or creating a new view.
4. You can create your own tokenizer:
If you require WideString or StoppWord support, or need to exclude certain
characters from the full text index, you can completely customize the FTS
tokenizer. A porter stemmer tokenizer is part of the standard distribution.
Searching for "run" it fins "run", "runs", "running", etc.
Delphi Implementation
The free DISQLite3 Personal edition contains the SQLite3 database engine as well
as all FTS modules: FTS1, FTS2, and FTS3. Caution: Only use FTS3 or later. Do
NOT use FTS1 or FTS2, they contain a design flaw which can lead to database
corruption.
Compile the full text search demo project for a first impression of the
performance and usage benefits which your application will gain from using
DISQLite3 and full text search!
Ralf
"Edwin" <edwinyeah@(nospam)gmail.com> wrote:
Really? good!
But I still have one thing not clear, I want to creat a table in SQLite with
structure below:
keyword, file_path, object_id
and when searching we use a SQL like:
select file_path, object_id from mytable where keyword like '%akeyword%'
what's the advantage of using the full-text API instead of the
aforementioned approach? Thanks.
---
The Delphi Inspiration
http://www.yunqa.de/delphi/
.
- Follow-Ups:
- Re: need to implement full text search
- From: Edwin
- Re: need to implement full text search
- References:
- need to implement full text search
- From: Edwin
- Re: need to implement full text search
- From: Franz-Leo Chomse
- Re: need to implement full text search
- From: Edwin
- need to implement full text search
- Prev by Date: Re: Alternative to TPageControl
- Next by Date: Re: Looking for super fast CSV parser
- Previous by thread: Re: need to implement full text search
- Next by thread: Re: need to implement full text search
- Index(es):
Relevant Pages
|