我不确定如何使用sql server 2008全文搜索来搜索地址匹配。这是我尝试过但它没有返回任何记录。
TableA
------
Address1
Address2
City
State
Zip
表格中的所有上述列都是全文索引的。假设用户输入了 “123 Apple street FL 33647”和我在表中的记录为
Address1 =“123”,Address2 =“Apple street”,City =“Tampa”,State =“FL”和Zip =“33647”我希望查询返回此信息。能告诉我怎么做吗?
query tried
--------------
SELECT * FROM TableA
WHERE CONTAINS((Address1, Address2, City, State, zip),
N'FORMSOF(THESAURUS, 123AppleStreetFL33647)');
If I put spaces in the search word, it is giving syntax error.
谢谢, 斯里达尔。
答案 0 :(得分:-1)
您必须使用正确的语法:
SELECT * FROM TableA
WHERE CONTAINS((Address1, Address2, City, State, zip),
N'FORMSOF(THESAURUS, 123) AND FORMSOF(THESAURUS,'Apple') .. etc);