Jump to content

How to detect if a file has already been indexed by the index serv


Recommended Posts

Guest V. Arun Kumar Patro
Posted

When I copy a file (e.g. 21025891.txt) to scope path of the Catalog and run

the following code immediately after that, index server did not provide me

any result.

However, after few minutes the same code returned me the desired results.

 

Dim odbSearch As New System.Data.OleDb.OleDbConnection, _

cmdSearch As New System.Data.OleDb.OleDbCommand, _

rdrSearch As System.Data.OleDb.OleDbDataReader

 

odbSearch.ConnectionString = "Provider=""MSIDXS"";Data Source=""CSCatalog"";"

cmdSearch.Connection = odbSearch

 

cmdSearch.CommandText = "select fileName,directory from scope() where

filename='21025891.txt' and Contains('(""Note"") & (""financial"") &

(""statement""|""information"")')"

 

odbSearch.Open()

rdrSearch = cmdSearch.ExecuteReader()

 

If rdrSearch.HasRows = True Then

While rdrSearch.Read()

Console.WriteLine(rdrSearch(0).ToString())

End While

rdrSearch.Close()

end if

 

odbSearch.Close()

 

 

How can I be able to programmetically know the time I need to wait to run

the above code for correct results?

 

Thanks

V. Arun Kumar Patro

  • Replies 0
  • Created
  • Last Reply

Popular Days


×
×
  • Create New...