samedi 23 avril 2016

SQLite, text search FTS etc

I am doing some updates and repairs on some old D5 business stuff (freebie for friend) with SQLite3 so have to use Zeos 6.6

I would like to speed up a text search which currently uses two BLOB_TEXT Fields, "Class" and "Methods"

if not(cbSearchMatchCase.Checked) then
  SearchText:=UpperCase(SearchText);
while not(dm.tbl.EOF) do
begin
  SearchData:=dm.tbl.FieldByName(fldClass).AsString+' '+
              dm.tbl.FieldByName(fldMethods).AsString;
  if not(cbSearchMatchCase.Checked) then
    SearchData:=UpperCase(SearchData);
  MatchFound:=AnsiPos(SearchText,SearchData) > 0;
  dm.tbl.Edit;
  dm.tbl.FieldByName(fldSearch).AsBoolean:=MatchFound;
  dm.tbl.Post;
  pbMain.StepIt;
  dm.tbl.Next;
end;

Can anyone point me at some code for using the SQLite FTS extension or something quicker than the above?

I found this but can't get it to work for way too many reasons to define here. I am sure it works as Žarko Gajić stuff is always spot-on, but just not working this installation. :) http://ift.tt/1Tq8n2V ... g-project/

Just find this link here... Does BLOB data types in SQLite supports FULL-text search?

That might explain why nothing seems to work, The BLOB_TEXT is being ignored? Yes? No?

Any snippets to speed this Text Search up?

Aucun commentaire:

Enregistrer un commentaire