使用 Windows 搜索服务,我查询并获取文档的元数据,例如ItemName
.
有没有办法获取找到的文本snip of the text
,以便向用户显示上下文?
string connectionString = "Provider=Search.CollatorDSO.1;Extended Properties=\"Application=Windows\"";
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
string Query = @"SELECT System.ItemName, System.ItemPathDisplay, System.Title, System.ItemUrl FROM SystemIndex WHERE scope ='file:c:\Index' and FREETEXT('Happy')";
OleDbCommand command = new OleDbCommand(query, connection);
connection.Open();
....