开发者

Is it possible to extend the Windows Search index with just a Filter handler?

开发者 https://www.devze.com 2023-02-21 04:48 出处:网络
I want to try and extend the Windows Search index with some custom data I have.To do this, I have put the data in a custom file format, and wrote a Windows Search filter handler that knows how to开发者

I want to try and extend the Windows Search index with some custom data I have. To do this, I have put the data in a custom file format, and wrote a Windows Search filter handler that knows how to开发者_运维问答 register a new file type with the indexer. It appears as though my code should work: when I register the DLL, the new filetype shows up in the list of indexable "File Types" in the Indexing options, and when I run filtdump.exe against my custom file type, it correctly outputs the values I want output for each chunk.

That being said, I can't get the values to show up in the Windows Search index. I've tried re-indexing (multiple times), I've tried changing the advanced Index options to "Index properties and file contents". I'm putting my custom files in indexed locations, like the Documents folder and the Desktop.

At a high-level: is it really possible to extend the Windows search index with just a filter handler that works with a custom file format? It says in the docs that you must implement a shell data source with a protocol handler to extend the index, but then says in other places that if you're just adding a new custom file format, you just have to create a filter handler (or a protocol handler). I'm not sure what's correct. I don't really need a shell data source for what I'm trying to accomplish.

If there are any testing ideas that people have out there, those would be appreciated too. Thanks!


You need to add the correct registry keys for the IFilter to be registered. There are 2 main keys, one is to register the handler, and the other is to register the given file extension to use your handler. If you look at the FilterSample in the windows search SDK examples (http:// www.microsoft.com/download/en/details.aspx?displaylang=en&id=7388).

To register the class do: http://msdn.microsoft.com/en-us/library/ms692540%28v=VS.85%29.aspx To register it with a given file extension: http://msdn.microsoft.com/en-us/library/ms692488%28v=VS.85%29.aspx

Unfortunately, it will still index as English and use the English WordBreaker and English Stemmer and the english noise file (stop words) filtering which is in C:\windows\system32\noise.dat and \noise.enu.

I'll let you know if I figure out how to fix that part.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号