我正在尝试搜索上传到文件夹中的文档的内容。如果我正在搜索一个字,它工作正常。如果我提供部分工作,它就无法运作。例如如果我使用 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