我对SQL很陌生,但我需要对多列进行全文搜索,从我读过的内容中你只能设置1个索引?
使用MSSQL 2005进行快速管理
这是我认为我想运行以按相关性搜索订单的查询,但我对如何设置全文搜索索引感到困惑
SELECT KEY_TBL.RANK, FT_TBL.Name, dbo.Parts.PartNo as PartN, dbo.Parts.Description as Descr, dbo.Parts.ListPrice as ListP, dbo.ParamLocation.name as LocationC
FROM (dbo.Parts AS FT_TBL
INNER JOIN
FREETEXTTABLE(dbo.Parts, *,'{$keyword}') AS KEY_TBL
ON FT_TBL.StId = KEY_TBL.[KEY]) INNER JOIN
ORDER BY KEY_TBL.RANK DESC
我是否正确地说下一个setp将作为查询运行:
USE products
sp_fulltext_database 'enable'
GO
CREATE FULLTEXT CATALOG PartsFT
WITH ACCENT_SENSITIVITY = OFF
GO
CREATE FULLTEXT INDEX ON dbo.Parts
(PartNo, Description TYPE COLUMN FileExtension LANGUAGE 1033)
KEY INDEX PartNo
ON PartsFT
WITH STOPLIST = SYSTEM
Go
数据库名称:products,table:dbo.Parts和我需要索引的列,ParNo是主键varchar(50)和Description是nvarchar(100)
通常我会玩,但我在这个数据库上承担不起任何错误!