Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Two Simultaneous Operations Error - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
astair
#1 Posted : Monday, January 25, 2016 9:52:40 PM
Rank: Newbie

Groups: Registered

Joined: 8/26/2015
Posts: 5
Location: USA
We have this code to add to the index when a ticket is created so that the search unit has immediate access to the page:
Code:
Dim configuration As Keyoti.SearchEngine.Configuration = New Keyoti.SearchEngine.Configuration
configuration.IndexDirectory = Server.MapPath("~/Keyoti_Search_Index")

Dim documentIndex As Keyoti.SearchEngine.Index.DocumentIndex = New Keyoti.SearchEngine.Index.DocumentIndex(Configuration)
Try

'-----------------------------
Dim reader As New Keyoti.SearchEngine.Documents.Reader(configuration)
reader.GetStream(new Uri("http://hd.alro.com/login.aspx?searchusername=username&searchpassword=Password")).Close()
'-----------------------------

documentIndex.AddDocument(New Keyoti.SearchEngine.Documents.Document(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & "/TicketView.aspx?ID=" & NewID, configuration))
Finally
documentIndex.Close()
End Try


I am intermittently getting the following error for the second dim line in the above code:

Quote:
You can not run two simultaneous operations on the same index directory


Any ideas about how to clear it up? Maybe just a simple delay between the configuration line and the documentindex line?
Jim
#2 Posted : Tuesday, January 26, 2016 1:25:08 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Please see "Asynchronous Adding" here https://keyoti.com/produ...ammatic%20Importing.htm

The reason for your problem is most likely that you are occasionally trying to add 2 documents at the same time. If you use the code in the above article, it will queue the documents in the background and add them when possible.

Best
Jim
-your feedback is helpful to other users, thank you!


astair
#3 Posted : Tuesday, January 26, 2016 3:16:10 PM
Rank: Newbie

Groups: Registered

Joined: 8/26/2015
Posts: 5
Location: USA
This seems to have worked great. Thank you.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.