#1 2017-08-16 18:28:15

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

FTS and Soundex/SoundexFR

Hi everyone,

I'm doing some tests with FTS search, I need to have a mORMot server which will only be accesed as localhost from a Node.js application on the same physical/virtual machine, I already have the server working and doing FTS search like this :

http://localhost:8081/root?sql=SELECT RowId, item FROM ListSearch WHERE item MATCH :('peri*'):

All is working as expected but there are situations where the end user can do a search with a mispelled word e.g. changing a B with a V, or an accented spanish character e.g. i instead of í so for example if the search term would be dosi I would like the search result include also words with dosí and viceversa so I am looking for the Soundex/SoundexFR funcion mentioned on the docs, but I don't know how to ( and if ) the function can be included on a request as shown above.

Can anyone give any help with this ?

Offline

#2 2017-08-16 18:36:35

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

Re: FTS and Soundex/SoundexFR

You need to define either a SQL function, or enhance FTS stemming...

Offline

#3 2017-08-16 19:02:09

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: FTS and Soundex/SoundexFR

I beg your pardon can I find that on the mORMot docs, or in any of the samples?

Offline

#4 2017-08-17 07:53:44

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

Re: FTS and Soundex/SoundexFR

For effective query, you may have to store the soundex 32-bit integer value in a dedicated column, then index it.

But if you want to use pattern matches, you may need to compute the soundex on the fly with the truncated value... but then it will be brute force search, since you can't use an index.
Check for instance https://synopse.info/files/html/Synopse … ml#TITL_22 to find out how to define a custom SQL function, if the existing SOUNDEX/SOUNDEXFR/SOUNDEXES SQLite3 functions are not enough for you.

Offline

#5 2017-08-17 13:55:13

moctes
Member
From: Mexico
Registered: 2013-05-11
Posts: 129

Re: FTS and Soundex/SoundexFR

Thank you Arnaud, I'll take a look at that

Offline

Board footer

Powered by FluxBB