Custom source for Windows 7 Start Menu Search
Asked Answered
R

1

12

I recently came across an article about Windows 7's new Federated Search and Search Connectors. Basically, you provide users a small XML file (.osdx; an OpenSearch XML file) and they can then use Explorer to search whatever you've got. These Search Connectors actually really easy to implement – Explorer calls your URL with a query and you just return the results as RSS.

Great. I'm currently working on a web app where this kind of functionality might be a nice little extra feature to provide to my users. So I installed the sample .osdx and tried it out. It works pretty much as advertised:


(source: msdn.com)

That's cool, but I want my search results to be available from the Start menu. The point (in my mind) would be to make items within my web app easily, quickly, and directly accessible when the app itself isn't already open. If I have to open an Explorer window, click on my Search Connector, and then search, what's the difference from just opening a browser and doing the search in the web app?

Here's what I've tried:

  • After the .osdx is installed, the Connector is saved as %UserProfile%\Searches\name.searchConnector-ms. Other items in this folder include Outlook's Connector. Looking at that file, there's a very promising node named <includeInStartMenuScope>. I added this node with a value of true to the Channel 9 Connector, but no luck. (I even tried a reboot.)
  • I came across a year-old question that asks just about the same thing. The accepted answer directs us to the Windows API Code Pack, but that only provides classes for consuming Windows Search, not implementing a Search Provider.
  • The registry trick from Scott Hanselman. However, this (a) only pins a link to run the search rather than including results inline, and (b) doesn't work for me since I (nor can I expect my users) to have Windows 7 Ultimate.

So, how do I supply items to the Start menu's instant search? Ideally, I'd like to just configure the Search Connector's results to be included, but I'm not opposed to wiring up something in C# that would be installed on the client computer.

Rubberneck answered 30/9, 2010 at 21:15 Comment(0)
L
2

Traditionally, the way to extend Windows Search has been via IFilters that allow Windows to understand new types of files. This approach will certainly tie you into the Start button results.

In this case, you are dealing with federated search, which makes online content act as if it were present on the user's computer.

Unfortunately, I can't find anything that obviously solves your problem. Consequently, you may have to build a kludge in 2 parts:

  1. An IFilter for your search results (say, a "*.C9" file).
  2. A file ending in "C9".

Incidentally, if you do a web search on the term "IFilter" and go to the first few search results, you might think that IFilters are no longer used due to a note at the top of the page.

If that happens, then you're at the old IFilter site. The current URL for the MSDN docs about this topic is at http://msdn.microsoft.com/en-us/library/bb266451(v=VS.85).aspx.

One last note of warning:

In Windows 7 and later, filters written in managed code are explicitly blocked. Filters MUST be written in native code due to potential CLR versioning issues with the process that multiple add-ins run in.

Lefton answered 5/10, 2010 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.