Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Programmatic re-import of IndexableSource not updating index? - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
bill
#1 Posted : Friday, November 11, 2016 2:01:34 AM
Rank: Advanced Member

Groups: Registered

Joined: 2/29/2008
Posts: 43
I'm using version 2012.5.14.903.

I'm trying to update the index programmatically. I use GetIndexableSourceForRecord to get the source I want to re-import (WebSiteBasedSource) and call Import(). I can see from the logs and the AddedDocument event handler that it's crawling and adding documents, but the index doesn't get updated. No slice files are generated and no indexer.txt is created with logging turned on.

What am I missing?
Jim
#2 Posted : Friday, November 11, 2016 3:48:46 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Hi Bill, if you're not getting any files being updated, not even logs, then it must be that your app is working on a different folder than the one you are looking at. Simple but easy mistake to make.

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


bill
#3 Posted : Friday, November 11, 2016 11:52:08 AM
Rank: Advanced Member

Groups: Registered

Joined: 2/29/2008
Posts: 43
I'm looking in the folder that my code is loading the index from. Other logs (CentralEventDispatcher, Document, HtmlDocumentParser, Reader, WebSiteSpider, XmlIndexableSourceRecordTable) are all being created. Is there a way the index would be going to a different folder?
Jim
#4 Posted : Friday, November 11, 2016 7:28:59 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Ok, so that sounds fine - can you ZIP up all logs and send to me via support@keyoti.com, so I can check them out.

To answer your question, there's no way that it's writing some files to one folder and others to a different folder.
-your feedback is helpful to other users, thank you!


Jim
#5 Posted : Friday, November 11, 2016 9:22:38 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Thanks for the files, in your CrawlSite method, you're not closing the DocumentIndex ('index' variable), add a call to Close() please and I think it will resolve it.

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


bill
#6 Posted : Friday, November 11, 2016 9:48:49 PM
Rank: Advanced Member

Groups: Registered

Joined: 2/29/2008
Posts: 43
Sorry, when I pulled my code together to send to you I grabbed pieces from different places and stuck them all in one method for simplicity, but I missed that bit. I am closing the index elsewhere. I also added a call to Flush to see if that would do anything, but it didn't help.
bill
#7 Posted : Friday, November 11, 2016 10:42:26 PM
Rank: Advanced Member

Groups: Registered

Joined: 2/29/2008
Posts: 43
Update on this: If I use index.ReimportIndexableSources() that appears to be working.
Jim
#8 Posted : Saturday, November 12, 2016 12:14:09 AM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,669
Location: Canada
Sorry, I missed that, yes the other thing you could do if you want to import one source only is

index.Import(source)

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


bill
#9 Posted : Saturday, November 12, 2016 8:56:46 PM
Rank: Advanced Member

Groups: Registered

Joined: 2/29/2008
Posts: 43
index.Import(source) worked correctly.
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.