0

我正在尝试搜索上传到文件夹中的文档内容。如果我要搜索的话,它工作正常。如果我提供部分工作,它就不起作用。例如,如果我使用Microsoft搜索,它会列出文档。但是如果我用Micro搜索它不会返回任何结果

以下是我的代码..

strQuery = String.Format("SELECT System.FileDescription, System.FileName, System.ItemPathDisplay,     System.ItemUrl  " & _ " FROM SystemIndex WHERE scope ='file:{0}' and Contains(*, '*{1}*')", folderpath,     strText)

''' Rendered query  
''' SELECT System.FileDescription, System.FileName, System.ItemPathDisplay, System.ItemUrl   FROM     SystemIndex WHERE scope ='file:c:\documents\UserDocumentFolder' and Contains(*, '*Micro*')

Dim connString As String = "Provider=Search.CollatorDSO.1;Extended Properties='Application=Windows';"

Dim cn As New System.Data.OleDb.OleDbConnection(connString) 
cn.Open() 
Dim _Adaptor As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn) 
Try
     _Adaptor.Fill(_tempTable) 
 Catch oleEx As OleDb.OleDbException
      General.WriteUnhandledError(oleEx) 
 Catch ex0 As Exception
      General.WriteUnhandledError(ex0) 
  End Try

  If _tempTable IsNot Nothing And _tempTable.Rows.Count > 0 Then 
       ''''' FOUND 
  Else 
        ''''' NOT FOUND 
  End If
4

0 回答 0