Quick script to rebuild full text search


Below is the script I learned while in Seattle attending PASS conference. Some guys from Microsoft helped me to rebuild full text index on some SharePoint databases I manage.

select * from sys.fulltext_catalogs

sp_configure ‘show adv’,0
reconfigure

— Get the fulltext catalog name to rebuild
select object_name(object_id), * from sys.fulltext_indexes

select * from docs where 1=0

select * from docs where contains(*,’SomeString’)

select extension,
count(*) from docs where extension <> ” group by extension

distinct extension is not null contains(*,’SomeString’)

select count(*) from docs

select * from master.dbo.sysfiles

–Rebuild fulltext catalog and index
ALTER FULLTEXT CATALOG ix_MyFullText REBUILD with accent_sensitivity=on

select fulltextcatalogproperty(‘ix_Catalog’, ‘populatestatus’)
select fulltextcatalogproperty(‘ix_Catalog’, ‘itemcount’)


One response to “Quick script to rebuild full text search”

  1. Log Buffer #22: A Carnival of the Vanities for DBAs…

    Welcome to the 22nd edition of
    Log Buffer, a
    weekly compendium of postings and news from database-related……

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.