views:

1269

answers:

1

Got a requirement to rebuild mssql full-text index.
Problem is - i need to know exactly when job is done. Therefore - just calling:

ALTER FULLTEXT CATALOG fooCatalog
REBUILD WITH ACCENT_SENSITIVITY = OFF

doesn't work or I'm doing something slightly wrong. :/

Any ideas?

+1  A: 

You can determine the status of the fulltext indexing by querying the indexing properties like this:

SELECT FULLTEXTCATALOGPROPERTY('IndexingCatalog', 'PopulateStatus') AS Status

Table Full-Text Populate Status

Displays the population status of the full-text indexed table.

The possible values are as follows:

0 = Idle.

1 = Full population is in progress.

2 = Incremental population is in progress.

3 = Propagation of tracked changes is in progress.

4 = Background update index is in progress, such as automatic change

tracking.

5 = Full-text indexing is throttled or pause
Magnus Johansson
So - the best option is to call this in while(status!=0)?
Arnis L.
Ehh... will be fine for now. Still better than waiting X seconds and hoping that rebuild will be finished.
Arnis L.
Yes, it would be nice if some event could be raised that you could subscribe on, but I don't think there is one to the best of my knowledge...
Magnus Johansson