#1 2014-11-06 16:30:44

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

What will happen if I change my TSQLRecord to TSQLRecordFTS4

Hi Arnaud,

Assume my program is already working with some TSQLRecord derived classes, all have string, integer, float and TDateTime fields.

if I change them to inherit from TSQLRecordFTS4, will all old functionalities still work? I mean, if non-string fields still working after changing to FTS4?

What I want is keep the old functions working, but plus some FTS functions provided by FTS4.

Thanks!


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2014-11-06 20:39:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: What will happen if I change my TSQLRecord to TSQLRecordFTS4

TSQLRecordFTS4 is a wrapper over a FTS4 virtual table.
By design, FTS3/FTS4 tables can only contain text.
See http://www.sqlite.org/fts3.html

So you just CAN NOT do what you want.
FTS is not for storage, but indexation.
You can even create a FTS table without any text stored, just the indexes.
This is what we do for our MVC sample - see TSQLArticleSearch class in https://github.com/synopse/mORMot/blob/ … CModel.pas and the following line when creating the model:

result.Props[TSQLArticleSearch].FTS4WithoutContent(
    TSQLArticle,['title','abstract','content']);

Offline

#3 2014-11-08 01:49:14

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: What will happen if I change my TSQLRecord to TSQLRecordFTS4

Thanks Arnaud.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#4 2014-11-08 08:33:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: What will happen if I change my TSQLRecord to TSQLRecordFTS4

Please take a look at the latest version of the documentation about TSQLRecordFTS3/4.
See http://synopse.info/files/html/Synopse% … tml#TITL_8

Offline

Board footer

Powered by FluxBB