I have an old website (https://www.recordsforliving.com/) with a search feature. Up until recently, it was running on Windows 2012 server, and used Microsoft Index Server, and ...

OleDbConnection IndexServerConnection = new OleDbConnection("Provider=msidxs;");
//Index Server Catalog name  
string CatalogName = "R4LWeb";
//Construct the Index Server query  
string SQL = "SELECT doctitle, FileName, VPath, Path, Write, Size, Rank ";
SQL += "FROM " + CatalogName + "..SCOPE() ";
SQL += "WHERE freetext(Contents, '\"" + QueryText + "\"') ";

to perform searches.

I recently migrated the website to a Windows 2016 VM, and I noticed the search feature was broken.

It appears MSFT has obsoleted their index service with Windows Search service, but none of that appears to have the ability to create your own indexed areas (catalogs), and to search with the OLE Provider=msidxs

I looked around, but haven't been able to find a good way to provide this functionality - which must be a pretty common need in websites.

I COULD write the search function myself: https://codereview.stackexchange.com/questions/136159/searching-files-in-a-directory-for-a-string provides a pretty good first approximation.

Is that what people do with ASP.Net websites that have some website search function? Or is there some other better tool? Is there some way to make msidxs on Windows Server 2016 (this is a legacy website and I'd rather not rewrite alot of code, even if its relatively simple).

  • 1
    Unfortunately asking for tool recommendations is off topic for this site. As a side note, judging from the code it looks like there might be a possible SQL injection vulnerability (unless you are sanitizing the string variables used when concatenating the SQL string) and a URL to the site on which the vulnerability exists. Might want to remove the URL maybe? – Greg Burghardt Jul 26 '18 at 16:13
  • I'm not sure I was asking for a tool recommendation, nor why that would be off-topic. Thanks for the catch on the injection issue. I had already noticed (when I ported/looked into the failure). But since the whole thing fails now and needs to be rewritten, its probably moot ;-). Thanks – Lewis Pringle Jul 26 '18 at 16:21
  • By "website search function" do you mean searching pages on your site by keyword? – Greg Burghardt Jul 26 '18 at 16:23
  • yes, search for pages / content on the site. – Lewis Pringle Jul 26 '18 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.