扩展SQL Server全文索引以搜索外键
您可以创建一个视图,提取所需的任何数据,然后将全文索引应用于该视图。该视图需要使用“ WITH SCHEMABINDING”选项创建,并且需要具有UNIQUE索引。
CREATE VIEW VehicleSearch
WITH SCHEMABINDING
AS
SELECT
v.Veh_ID,
v.Veh_Make,
v.Veh_Model,
v.Veh_LicensePlate,
a.Atr_Name as Veh_Color
FROM
Vehicle v
INNER JOIN
Attributes a on a.Atr_ID = v.FK_Atr_VehicleColor
GO
CREATE UNIQUE CLUSTERED INDEX IX_VehicleSearch_Veh_ID ON VehicleSearch (
Veh_ID ASC
) ON [PRIMARY]
GO
CREATE FULLTEXT INDEX ON VehicleSearch (
Veh_Make LANGUAGE [English],
Veh_Model LANGUAGE [English],
Veh_Color LANGUAGE [English]
)
KEY INDEX IX_VehicleSearch_Veh_ID ON [YourFullTextCatalog]
WITH CHANGE_TRACKING AUTO
GO
赞0
踩0