我有一个全文索引表,并尝试查询匹配多个单词的结果。例如,我有一个带有索引列的地址表address_text
,zip_code
和city
。
| ROW | address_text | zip_code | city |
| 1 | Bourbon street | 1234 | Baltimore |
| 2 | Bourbon street | 1234 | New Orleans|
现在我想搜索“Bourbon Baltimore”,只想要第一行。
我尝试了以下方法:
SELECT FT_TBL.* FROM ADDRESSES AS FT_TBL
INNER JOIN CONTAINSTABLE(ADDRESSES, *, '"Bourbon*" AND "Baltimore*"') AS KEY_TBL
ON FT_TBL.address_id = KEY_TBL.[KEY]
ORDER BY KEY_TBL.RANK, address_text
但它根本不会返回任何行。