我可以使用存储过程(sprocs)来填充我的全文索引吗?

时间:2021-11-22 16:28:19

I'm using SQL Server 2008 and I would like to use a sproc to tell the database to populate a full-text index.

我正在使用SQL Server 2008,我想使用sproc告诉数据库填充全文索引。

If available, I'd like to know what the sprocs are for the following actions:

如果可用,我想知道sprocs用于以下操作:

  • adding an entry into the index
  • 在索引中添加一个条目

  • removing an entry into the index
  • 删除索引中的条目

  • full populate

2 个解决方案

#1


sp_fulltext_catalog is what you're looking for.

sp_fulltext_catalog是你要找的。

From Books Online, if you were looking to rebuild (this a drop and create) a full-text catalog named Cat_Desc in the AdventureWorks database...

从联机丛书中,如果您要在AdventureWorks数据库中重建(这是一个drop并创建)一个名为Cat_Desc的全文目录...

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'rebuild';
GO

If you wanted to start full population of said catalog...

如果你想开始所述目录的完整人口......

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'start_full';
GO

If you wanted to perform incremental population of said catalog...

如果你想执行所述目录的增量填充...

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'start_incremental';
GO

#2


fulltext indexing does this automatically for you. So you either:

全文索引会自动为您执行此操作。所以你要么:

  • manually repopulate the index
  • 手动重新填充索引

or

  • set the index to auto-populate, and then you have the option to do this in the background (preferred)
  • 将索引设置为自动填充,然后您可以选择在后台执行此操作(首选)

The last option is the best, you simply have a set/forget system: when rows are changed/removed/added, the system takes care of the index, you don't have to do that.

最后一个选项是最好的,你只需要一个set / forget系统:当更改/删除/添加行时,系统会处理索引,你不必这样做。

#1


sp_fulltext_catalog is what you're looking for.

sp_fulltext_catalog是你要找的。

From Books Online, if you were looking to rebuild (this a drop and create) a full-text catalog named Cat_Desc in the AdventureWorks database...

从联机丛书中,如果您要在AdventureWorks数据库中重建(这是一个drop并创建)一个名为Cat_Desc的全文目录...

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'rebuild';
GO

If you wanted to start full population of said catalog...

如果你想开始所述目录的完整人口......

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'start_full';
GO

If you wanted to perform incremental population of said catalog...

如果你想执行所述目录的增量填充...

USE AdventureWorks;
GO
EXEC sp_fulltext_catalog 'Cat_Desc', 'start_incremental';
GO

#2


fulltext indexing does this automatically for you. So you either:

全文索引会自动为您执行此操作。所以你要么:

  • manually repopulate the index
  • 手动重新填充索引

or

  • set the index to auto-populate, and then you have the option to do this in the background (preferred)
  • 将索引设置为自动填充,然后您可以选择在后台执行此操作(首选)

The last option is the best, you simply have a set/forget system: when rows are changed/removed/added, the system takes care of the index, you don't have to do that.

最后一个选项是最好的,你只需要一个set / forget系统:当更改/删除/添加行时,系统会处理索引,你不必这样做。