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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...