我想在视图上创建FULLTEXT索引,但我不能,也看不出问题所在。
具有唯一聚集索引的视图:
-- View Creation
CREATE VIEW View_School_Degree WITH SCHEMABINDING AS
SELECT
s.Id_School [School Id]
,s.Name [School Name]
,s.Type
,s.Code
,CAST(CONCAT(s.Address1, N' ',s.Address2 , N', ', s.Address3, N' ', s.Address4) AS nvarchar(500)) [Postal Address]
,s.Email
,d.Id_Degree [Degree Id]
,d.Title [Degree Title]
,d.[Option] [Degree Option]
,CAST(CONCAT(d.Code, N' / ', d.[Option]) AS [nvarchar]) [Degree / Option]
,sd.Capacity
FROM dbo.School_Degree sd
JOIN dbo.School s ON s.Id_School = sd.Id_School
JOIN dbo.Degree d ON d.Id_Degree = sd.Id_Degree
GO
-- INDEX Creation
CREATE UNIQUE CLUSTERED INDEX [IX_View_School_Degree_Identifier] ON dbo.View_School_Degree
(
[School Id] ASC,
[Degree Id] ASC
)
使用FULLTEXT目录创建我的FULLTEXT索引:
CREATE FULLTEXT CATALOG SchoolCatalog
WITH ACCENT_SENSITIVITY = OFF
AUTHORIZATION dbo;
GO
CREATE FULLTEXT INDEX ON dbo.View_School_Degree
(
[School Name] LANGUAGE 1036
,[Degree Title] LANGUAGE 1036
,[Postal Address] LANGUAGE 1036
)
KEY INDEX IX_View_School_Degree_Identifier
ON SchoolCatalog
WITH STOPLIST OFF;
GO
我收到此错误:
“ IX_View_School_Degree_Identifier”不是用于应用全文本搜索键的有效索引。全文搜索关键字必须是唯一的索引,不接受Null值,只有一列不脱机,没有在计算得出的不确定性或不精确的非持久性列上定义,没有过滤器,并且最大值900个字节的大小。为全文键选择另一个索引
答案 0 :(得分:2)
您会在错误消息中看到,该部分显示:
IX_View_School_Degree_Identifier'不是有效的索引....只有一列
但是,您的索引由两列组成。您需要创建一个满足这些要求的新索引