Notifying the Index of Changes

[Windows Search 2.x is obsolete after Windows XP. Instead, use Windows Search.]

With Microsoft Windows Desktop Search (WDS) 2.6, protocol handlers for a given data store can tell the WDS Indexer when data in their store has changed. This improves performance by ensuring the Indexer doesn't crawl the entire store on incremental indexes. Using notification APIs, protocol handlers can notify the Indexer that an item has been moved or deleted, and they can add scopes to the WDS Indexer's crawl queue of URLs requiring indexing. Notification is helpful for applications such as email, where the protocol handler monitors the store and notifies the Indexer that items have changed and require indexing.


Protocol handlers notify the Indexer of changes through the ISearchItemsChangedSink interface. Information about data changes should be collected in SEARCH_ITEM_CHANGE structs and SEARCH_KIND_OF_CHANGE enumeration types and then communicated to the Indexer through the OnItemsChanged method of the ISearchItemsChangedSink interface.

To access this interface, a custom protocol handlers must first instantiate an ISearchManager object to gain access to the ISearchCatalogManager object. From there, one can instantiate an ISearchItemsChangedSink object and notify the Indexer of the data changes.

The OnItemsChanged method lets you collect and communicate data changes to your customer data store to initiate indexing.

IndwNumberofChangesTotal number of changes in the notification.
InDataChangeEntries[]All change notifications in an array of SEARCH_ITEM_CHANGE structures.
OutdwBatchIdThe batch ID that will be passed back with errors.
OuthrCompletionCodes[]Indicates whether each URL was accepted for indexing.


The SEARCH_ITEM_CHANGE structure identifies the kind of change that occurred as well as the item's current URL and previous URL, if applicable. The structure is defined as follows:

Property NameProperty TypeDescription
ChangeSEARCH_KIND_OF_CHANGEThe type of change that is being notified.
URLLPWSTRThe URL for the object that has changed.
OldURLLPWSTRIf the notification is a move, the old URL is provided and must be unique.
PrioritySEARCH_NOTIFICATION_PRIORITYThe priority of the change.


The SEARCH_KIND_OF_CHANGE enumeration is defined as follows:

Enum ValueValueDescription
SEARCH_CHANGE_ADD0The notification is for an additional URL.
SEARCH_CHANGE_DELETE1The notification is for the deletion of a URL.
SEARCH_CHANGE_MODIFY2The notification is that a URL has been modified.
SEARCH_CHANGE_MOVE_RENAME3The notification is for the move and rename of an object to a new URL.
SEARCH_CHANGE_SEMANTICS_DIRECTORY0x10000The notification is for a container URL.
SEARCH_CHANGE_SEMANTICS_SHALLOW0x20000The notification is for a container URL that should only have its container properties indexed.
SEARCH_CHANGE_SEMANTICS_SECURITY0x40000The notification is for a URL or container URL that has had its security properties changed.


The SEARCH_NOTIFICATION_PRIORITY enumeration is defined as follows:

Enum ValueValueDescription
SEARCH_NORMAL_PRIORITY0Only a normal priority should be used when indexing the URL. These notifications are processed before the normal background incremental indexing of a user's files and stores.