user1401288
user1401288

Reputation: 51

Create a catalog for Windows Search Service programmatically

I've been reading through the Windows Search Service documentation and samples for more than a day now, and while I've learned a lot, I still feel no closer to the answers I was looking for.

The context is I have a web app that uses Indexing Service for full-text searching. Because this is no longer supported and has loads of bugs, I want to migrate away from indexing service to Windows Search Service.

In the indexing service solution, I create a catalog for the documents I want to index (instead of using the default system index). Specifically, I use CIODMLib.AdminIndexServer objects to programmatically create catalogs as-needed.

That's all dandy until I need to migrate to WSS. At most I can find only the occasional allusion to catalogs in the WSS documentation and nothing about an API for creating them in say C#. So, the first question: Is there a way to create WSS catalogs programmatically?

As a followup question, is it even necessary to create multiple catalogs? Can I safely use SCOPE() (as in SQL Syntax) on the SystemIndex to performantly make full-text queries?

Upvotes: 3

Views: 1625

Answers (1)

KevinH
KevinH

Reputation: 111

I am having the same issue regarding full-text queries. However, I can answer that SCOPE can be used to limit the query, eliminating the need for multiple catalogs.

objRecordSet.Open "SELECT System.ItemName, System.ItemTypeText, System.Size FROM SystemIndex WHERE SCOPE='file:c:/users'", objConnection

This is taken almost word-for-word from the vbscript sample on TechNet.

Upvotes: 1

Related Questions