4 out of 15 rated this helpful - Rate this topic

Querying the Index Programmatically

There are several ways to use Windows Search to query the index.

This section provides the conceptual framework for querying the index programmatically:

Note  Legacy Microsoft Windows Desktop Search (WDS) 2x compatibility: On computers running Windows XP and later, ISearchDesktop is deprecated. Instead, developers should use ISearchQueryHelper to get a connection string and to parse the user's query into Structured Query Language (SQL), and then query through Object Linking and Embedding Database (OLE DB).

Additional Resources

Related topics

Windows Search Development Guide
Managing the Index
Extending the Windows Search Index
Extending Language Resources

 

 

Send comments about this topic to Microsoft

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Querying Index on External Drive
Hi. I have indexed my external FAT32 hard drive. I did this by applying Microsofts hotfix to allow indexing of UNC paths. All appeared to go well and it said that the files were indexed successfully. However when I try to programatically access the index I only get results returned from the internally indexed folder but not the external one. Anyone know how to resolve this one?

thank you.
Specifing SCOPE Prevents Adding Additional Constraints
When using the SCOPE or DIRECTORY constraints, other constraints cannot be considered.
For example:

"SELECT System.ItemUrl FROM SYSTEMINDEX.. SCOPE() WHERE SCOPE='file:c:Users/User1' AND System.Keywords='someKeyWords'

Any solution would be appreciated.

ADO.NET and C# code sample wrong

The ADO.NET and C# code sample does not work unless you use the connection string from the Visual Basic sample.

The recommended way to get the correct connection string is to use the QueryHelper Object get_ConnectionString() method (see http://msdn2.microsoft.com/en-us/library/bb266518(VS.85).aspx for sample code)