Windows Search Service : Search Partial Content

495 views Asked by At

I am trying to search in content of the documents uploaded into a folder. It is working fine if i am giving a word to search. It is not working if i m giving part of work. e.g. If I search with Microsoft, It lists documents. but if i search with Micro it is not returning any result

Following is my code..

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
0

There are 0 answers