Full text search of files Search.CollatorDSO.1

bsim365 116 Reputation points
2023-01-31T20:40:42.12+00:00

We are moving a site off an old server and need to update our search object that is no longer available on Server 2019. We currently query a catalog based on submitted search term and select doctitle, filename, size, path, url from a folder path and use the MSIDXS.1 oledbconnection to fill a dataset.

MSIDXS is no longer an option and from I've gathered i need to use Search.CollatorDSO.1. Problem is I can't get the right values back and can't seem to figure out how to limit the search scope. I'm attempting to use:

System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection("Provider=Search.CollatorDSO.1;Extended Properties='Application=Windows';");
        conn.Open();
        System.Data.OleDb.OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter("SELECT System.ItemName, System.ItemUrl, System.DateCreated FROM SystemIndex", conn);

I've tried selecting many fields that should work, but do not. The only values i get back are System.ItemUrl and System.DateCreated.

I have already installed the windows search service feature and added the folder i want to search in indexing options.

Not sure next steps, why can i only pull 2 fields back, how to i use only the folder i want to search in the scope?

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,484 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,971 Reputation points
    2023-02-02T11:09:04.48+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.

    It looks like you're trying to use the OleDb provider for Windows Search, but having trouble getting the desired results. Here are some suggestions that might help:

    1. Check the fields that are available for search: The "SystemIndex" table provides access to the Windows Search index, but the specific fields that are available for search may vary depending on the configuration of the search index and the types of files being searched. You can try using other fields from the SystemIndex table to see if they are available for search, such as "System.Author" or "System.Keywords".
    2. Use the correct syntax for the SELECT statement: The SELECT statement should use the correct syntax for accessing the fields from the SystemIndex table. You may need to use square brackets to escape field names that contain spaces, for example:

    System.Data.OleDb.OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter("SELECT [System.ItemName], [System.ItemUrl], [System.DateCreated] FROM SystemIndex", conn);

    1. Limit the search scope: To limit the search scope to a specific folder, you can use the "SCOPE" clause in your SELECT statement. For example:

    System.Data.OleDb.OleDbDataAdapter cmd = new System.Data.OleDb.OleDbDataAdapter("SELECT [System.ItemName], [System.ItemUrl], [System.DateCreated] FROM SystemIndex WHERE SCOPE='file:' + 'C:\MyFolder'", conn);

    Note that the folder path must be expressed as a file URL.

    1. Check for errors: If you're still having trouble, you can try wrapping the OleDbDataAdapter object in a try-catch block to capture any exceptions that are thrown during the search operation. The exception message might provide additional information that can help you diagnose the problem.

    These are a few suggestions to help you resolve the issues you're facing with the Windows Search index and the OleDb provider for Windows Search. I hope this information is helpful!

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

  2. bsim365 116 Reputation points
    2023-04-10T05:00:52.0566667+00:00

    How do I: "Check the fields that are available for search: The "SystemIndex" table provides access to the Windows Search index, but the specific fields that are available for search may vary depending on the configuration of the search index and the types of files being searched. You can try using other fields from the SystemIndex table to see if they are available for search, such as "System.Author" or "System.Keywords"." I can still only get back itemurl, size, datemodified, and search.rank. asp files are in types of files being search. I need to get the html title out of the page that is being indexed.

    0 comments No comments