开发者

Is there easy way to match word from a database table field with soundex?

开发者 https://www.devze.com 2023-02-03 20:20 出处:网络
Hi Just Before going deep into soundex, wanted to ask quick qiestion. 开发者_如何学编程1 - field in the table[title] contains a \"Sentence that has WORD I am looking for\"

Hi Just Before going deep into soundex, wanted to ask quick qiestion.

开发者_如何学编程1 - field in the table[title] contains a "Sentence that has WORD I am looking for"

Q - Is there are easy way to match the WORD using a sundex ?


SOUNDEX is a way to match Smith, Smythe and Smeathe while searching for Smith:

SELECT  *
FROM    names
WHERE   name_soundex = SOUNDEX('Smith')

name     name_soundex
--
Smith    S530
Smythe   S530
Smeathe  S530

What you need is called FULLTEXT indexing:

CREATE FULLTEXT INDEX fx_mytable_title ON mytable (title)

SELECT  *
FROM    mytable
WHERE   MATCH(title) AGAINST ('+fox')

title
--
A quick brown fox jumped over the lazy dog
0

精彩评论

暂无评论...
验证码 换一张
取 消