0

I am attempting to search files on a website using the Windows Search API, eactly as the accepted answer to this question. Briefly:

var con = new OleDbConnection("Provider=Search.CollatorDSO;EXTENDED PROPERTIES='Application=Windows'");
...
"SELECT System.ItemName FROM SystemIndex WHERE SCOPE='file:C:\inetpub\wwwroot\[MySite]' ";

However, it never returns any items.

I discovered that a wide-open query (no scope) only returns files within C:\Users\[me]

For instance, it finds files on my desktop, but not in C:\Windows. I am a local admin, and can find no mention of permission restrictions.

I've tried it in webforms and winforms both locally and deployed remotely. Same behavior.

Does anyone have a solution?

Community
  • 1
  • 1
mr_plum
  • 2,448
  • 1
  • 18
  • 31

1 Answers1

0

I'm answering my own question.

My "problem" had nothing to do with permissions; it was caused by ignorance of how Windows Search works.

I stumbled upon an Advanced Indexing Options article from MSFT and realized that it was only indexing files in my user profile, start menu, and IE history. I manually added my website folder to the index and everything started working as if by magic.

mr_plum
  • 2,448
  • 1
  • 18
  • 31