我目前正在尝试在唯一列上创建全文索引。表定义是:
CREATE TABLE [dbo].[DictionaryWords](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Word] [varchar](255) NOT NULL,
[Frequency] [int] NOT NULL,
CONSTRAINT [PK_DictionaryWords] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
CONSTRAINT [UX_Word] UNIQUE NONCLUSTERED
(
[Word] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
然后我创建了全文目录:
CREATE FULLTEXT CATALOG ft AS DEFAULT
最后尝试创建全文索引:
CREATE FULLTEXT INDEX ON DictionaryWords(Word) KEY INDEX UX_Word
但是我收到了错误:
Full-Text Search is not installed, or a full-text component cannot be loaded
安装全文搜索,如命令所示:
SELECT SERVERPROPERTY('IsFullTextInstalled')
返回值1.因此,问题可能是"无法加载全文组件"。
我接下来应该看看什么想法?
答案 0 :(得分:1)
这就是我打开它的方式:
答案 1 :(得分:0)
看起来问题是在安装全文组件之前创建了全文目录。
我很幸运能够放弃数据库并从头开始重新创建表格。以上三个命令现在有效。
如果我不能删除数据库,那么可能会删除全文目录并重新创建它会解决它(比我的drop database sledgehammer方法更好!)