Implementing IUrlAccessor

The IUrlAccessor interface provides methods for handling individual items from the search component. The UrlAccessor object is created in the security context specified by rules associated with the search component.

An instance of the UrlAccessor object is created and initialized in the CreateAccessor method of the ISearchProtocol interface. If an internal initialization method was implemented for the UrlAccessor object, that method is invoked immediately after the object is created. If you implement this method, it performs initialization specific to your protocol handler implementation, such as validating the URL for the item being accessed. It can also check the last time the item was modified to determine if that file must be processed in the current crawl.

All of the Get methods on the UrlAccessor object are then called to retrieve standard properties associated with the item. Depending on which was implemented, the item's URL is passed to the GetFileName method or to the BindToStream method to read the content of the item. If the URL indicates that the item contains an embedded document that must also be filtered, the BindToFilter method is called. The Filter Daemon calls this method only once for each item. If the item contains one or more embedded documents, you can filter it by using an IFilter interface that can process these documents.

The GetSecurityDescriptor method retrieves the security information associated with the URL item, such as the different kinds of access allowed for particular users and groups of users. If you implement this method, the search component provides the index component with security information about the item when it is crawled. The index component incorporates this information into the full-text index with the document content. The search engine uses the security information when it executes queries against the full-text index. Therefore, if you don't implement the GetSecurityDescriptor method, all users are able to retrieve and view the contents of the URL item in their search query results.

The GetSecurityDescriptor method also allows you to use custom mappings between users registered to a content source and those users registered on the domain, if they are different.

For more information about designing and creating security descriptors, see the Microsoft Active Directory directory service topic in the Directory Services section of the Microsoft Platform SDK.

Implementing ISearchProtocol