IFilter interface
Scans items for text and properties. Methods of this interface extract chunks of text from items, filtering out embedded formatting and retaining information about the position of the text. The methods also extract chunks of values that are properties of an entire item or of well-defined parts of the item. IFilter provides the foundation for building higher-level applications such as document indexers and application-independent viewers.
Members
The IFilter interface inherits from the IUnknown interface. IFilter also has these types of members:
Methods
The IFilter interface has these methods.
| Method | Description |
|---|---|
| BindRegion |
This method is reserved for future use. |
| GetChunk |
Retrieves a description of the current chunk and positions the filter at the beginning of the next chunk, or at the first chunk if this is the first call to the GetChunk method. |
| GetText |
Retrieves text (text-type properties) from the current chunk, which must have a CHUNKSTATE enumeration value of CHUNK_TEXT. |
| GetValue |
Retrieves a value (internal value-type property) from a chunk, which must have a CHUNKSTATE enumeration value of CHUNK_VALUE. |
| Init |
Initializes a filtering session. |
Remarks
IFilter components for Windows Search run in the Local Security context and should be written to manage buffers and to stack correctly. All string copies must have explicit checks to guard against buffer overruns. You should always verify the allocated size of the buffer and test the size of the data against the size of the buffer.
When to Implement
Implement this interface if you are providing a filter to extract information from a proprietary file format so that the text and properties can be included in the index. Full-text search engines like Windows Search call the methods of this interface to extract text and property information for creating an index. Text viewers can also use this interface after a query, for example, to show the hit highlights for that file.
The IFilterSample code sample, available on Code Gallery and the Windows 7 SDK, demonstrates how to create an IFilter base class for implementing the IFilter interface.
For conceptual information about IFilter implementation, see Developing Filter Handlers. For information about IFilters and property handlers, see "Full-Text Support" and "Operating System Implementation Considerations" in Developing Property Handlers for Windows Search.
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Redistributable |
Windows NT 4.0 Option Pack |
|
Header |
|
See also