我用了下面的官方文档例子在机器A上建全文索引,执行最后的全文查询语句没有问题,但是在机器B上同样做这样的例子后,用最后查询语句却查不出数据来,查询也不报错就是查不出数据!
请问机器B是哪里设置的不对?例子如下:
USE pubs
-- Create and populate a table.
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'FulltextTest')
DROP TABLE FulltextTest
GO
CREATE TABLE FulltextTest
( article_id int IDENTITY(100,1)
CONSTRAINT PK_title_id PRIMARY KEY,
article_title nvarchar(200)
)
GO
INSERT FulltextTest (article_title) VALUES (N'Steven Buchanan has always enjoyed ice skating.')
INSERT FulltextTest (article_title) VALUES (N'Elvis Stoiko: The best male figure skater')
INSERT FulltextTest (article_title) VALUES (N'Steven Buchanan On Ice: Skating Reaches Tops in Public Opinion Poll')
INSERT FulltextTest (article_title) VALUES (N'Last night, Steven Buchanan skated on the ice!! Skating fans cheer!')
INSERT FulltextTest (article_title) VALUES (N'Ice-skating brings out the best in Steven. Buchanan exults in first victory...')
GO-- Enable full-text searching in the database.
EXEC sp_fulltext_database 'enable'
GO-- Create a new full-text catalog.
EXEC sp_fulltext_catalog 'StevenBCatalog',
'create'
GO-- Register the new table and column within it for full-text querying,
-- then activate the table.
EXEC sp_fulltext_table 'FulltextTest',
'create',
'StevenBCatalog',
'PK_title_id'
EXEC sp_fulltext_column 'FulltextTest',
'article_title',
'add'
EXEC sp_fulltext_table 'FulltextTest',
'activate'
GO-- Start full population of the full-text catalog. Note that it is
-- asynchronous, so delay must be built in if populating a
-- large index.EXEC sp_fulltext_catalog 'StevenBCatalog',
'start_full'
WHILE (SELECT fulltextcatalogproperty('StevenBCatalog',
'populatestatus')) <> 0
BEGIN
WAITFOR DELAY '00:00:02' -- Check
every 2 seconds to see if full-text index population is complete.
CONTINUE
ENDGO-- Execute a full-text query against the new table.
SELECT article_title
FROM FulltextTest
WHERE CONTAINS(article_title, ' "Steven Buchanan" AND "ice skating" ')下面是结果集:article_title
------------------------------------------------------------------------
Steven Buchanan has always enjoyed ice skating.
Last night, Steven Buchanan skated on the ice!! Skating fans cheer!
Steven Buchanan On Ice: Skating Reaches Tops in Public Opinion Poll
Ice-skating brings out the best in Steven. Buchanan exults in first victory...
(4 row(s) affected)
请问机器B是哪里设置的不对?例子如下:
USE pubs
-- Create and populate a table.
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'FulltextTest')
DROP TABLE FulltextTest
GO
CREATE TABLE FulltextTest
( article_id int IDENTITY(100,1)
CONSTRAINT PK_title_id PRIMARY KEY,
article_title nvarchar(200)
)
GO
INSERT FulltextTest (article_title) VALUES (N'Steven Buchanan has always enjoyed ice skating.')
INSERT FulltextTest (article_title) VALUES (N'Elvis Stoiko: The best male figure skater')
INSERT FulltextTest (article_title) VALUES (N'Steven Buchanan On Ice: Skating Reaches Tops in Public Opinion Poll')
INSERT FulltextTest (article_title) VALUES (N'Last night, Steven Buchanan skated on the ice!! Skating fans cheer!')
INSERT FulltextTest (article_title) VALUES (N'Ice-skating brings out the best in Steven. Buchanan exults in first victory...')
GO-- Enable full-text searching in the database.
EXEC sp_fulltext_database 'enable'
GO-- Create a new full-text catalog.
EXEC sp_fulltext_catalog 'StevenBCatalog',
'create'
GO-- Register the new table and column within it for full-text querying,
-- then activate the table.
EXEC sp_fulltext_table 'FulltextTest',
'create',
'StevenBCatalog',
'PK_title_id'
EXEC sp_fulltext_column 'FulltextTest',
'article_title',
'add'
EXEC sp_fulltext_table 'FulltextTest',
'activate'
GO-- Start full population of the full-text catalog. Note that it is
-- asynchronous, so delay must be built in if populating a
-- large index.EXEC sp_fulltext_catalog 'StevenBCatalog',
'start_full'
WHILE (SELECT fulltextcatalogproperty('StevenBCatalog',
'populatestatus')) <> 0
BEGIN
WAITFOR DELAY '00:00:02' -- Check
every 2 seconds to see if full-text index population is complete.
CONTINUE
ENDGO-- Execute a full-text query against the new table.
SELECT article_title
FROM FulltextTest
WHERE CONTAINS(article_title, ' "Steven Buchanan" AND "ice skating" ')下面是结果集:article_title
------------------------------------------------------------------------
Steven Buchanan has always enjoyed ice skating.
Last night, Steven Buchanan skated on the ice!! Skating fans cheer!
Steven Buchanan On Ice: Skating Reaches Tops in Public Opinion Poll
Ice-skating brings out the best in Steven. Buchanan exults in first victory...
(4 row(s) affected)
B 不能通只能比对一下A、B之间的差异!
向楼上说的操作系统,Server版本等等的一致性。