Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Force Index of a new page when added - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
cmpenney
#1 Posted : Thursday, August 6, 2015 5:15:38 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
WE are trying to setup SearchUnit to replace the current search on our HelpDesk. So far the users like it however as new tickets are added they don't get indexed for some time so searches for the ticket ID or other known keywords don't return the new ticket in the results.

Is there a way to call something that will index the new page as soon as it is added?
admin
#2 Posted : Thursday, August 6, 2015 8:31:21 PM
Rank: Administration

Groups: Administrators

Joined: 8/13/2004
Posts: 66
Hi - thanks for posting.

Sure. You can add/remove documents from the index incrementally.

Please see this page from the documentation which has full details;
https://keyoti.com/products/search/dotNetWeb/HtmlHelp6/UserGuide/Examples/Programmatic%20Importing.htm

Let me know if you have any trouble at all.

Dan
Keyoti
cmpenney
#3 Posted : Thursday, August 6, 2015 9:55:13 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
I've put the code in place and it seems to be running without errors but when I go to search for information on the page I just entered I get zero results:


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
documentIndex.AddDocument(New Keyoti.SearchEngine.Documents.Document(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & "/TicketView.aspx?ID=" & NewID, configuration))
Finally
documentIndex.Close()
End Try
Jim
#4 Posted : Thursday, August 6, 2015 10:06:36 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Let me jump in and help on this question.

Assuming you have the path correct here

configuration.IndexDirectory = Server.MapPath("~/Keyoti_Search_Index")

then the only other question would be whether the document URL is indeed correct.

I'd suggest adding this

configuration.Logging = true

before adding the document, and then look in the index directory for .txt files (which are the log files). Probably the Document.txt or DocumentIndex.txt files will have something interesting. If it doesn't help please send them to me at support @ keyoti.com or paste the content here.

If there aren't even log files, then it probably means the IndexDirectory path is incorrect.

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


cmpenney
#5 Posted : Friday, August 7, 2015 1:28:40 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
Added the logging option and it did create a couple text files in my index directory.

Document.txt:
08/07/2015 08:21 Read()http://devhd.alro.com/TicketView.aspx?ID=218478
mem change for doc: 0MB current mem alloc: 8MB

HtmlDocumentParser.txt:
08/07/2015 08:21 ReadLinks() from HTMLDocumentParserClass called
08/07/2015 08:21 ReadLinks finished

Indexer.txt:
08/07/2015 08:21 Indexing: http://devhd.alro.com/TicketView.aspx?ID=218478
08/07/2015 08:21 Joining slices.
08/07/2015 08:21 Slice: 332421

Reader.txt:
08/07/2015 08:21 GetStream for http://devhd.alro.com/TicketView.aspx?ID=218478

XmlDataAccess.txt:
08/07/2015 08:21 MarkIndexLocked method - lock being applied
08/07/2015 08:21 MarkIndexLocked method - lock applied
08/07/2015 08:21 EnsureDataStore method successfully finalized
08/07/2015 08:21 MarkIndexValid method - creating validIndex file and storing phraseMatching setting
08/07/2015 08:21 MarkIndexValid method - File indexValid succesfully created, and phraseMatching setting memorized
08/07/2015 08:21 Close method called - updating the xml files
08/07/2015 08:21 MarkIndexLocked method - lock removed

XmlIndexableSourceRecordTable.txt:
08/07/2015 08:21 GetIndexableDataSources method successfully retrieved the indexed data sources



I double checked and the URL listed above ( http://devhd.alro.com/TicketView.aspx?ID=218478) is the right URL. Pasting it into my address bar takes me to the data I expect to see. However if I search on the ticket number: 218478 I get no results.


Jim
#6 Posted : Friday, August 7, 2015 3:42:50 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
If you search for other text in the page, does it work? Does the ticket number appear on the page, or only in the URL?
-your feedback is helpful to other users, thank you!


cmpenney
#7 Posted : Friday, August 7, 2015 3:45:00 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
Searching for other text fails and well and the number does appear on the page.
Jim
#8 Posted : Friday, August 7, 2015 4:34:13 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
Other things I can think of

- If you open the index directory with our Index Management Tool, and find

/TicketView.aspx?ID=218478

in the list of documents (such as by entering 218478 in the filter) you can right click the row and go to More Information. This will show you the text that it indexed, can you copy it here?

- Do you have to log in to be able to view that URL /TicketView.aspx?ID=218478

- Are you certain the search is using the same index directory, trying a search from the Index Management Tool would also be a good test.
-your feedback is helpful to other users, thank you!


cmpenney
#9 Posted : Friday, August 7, 2015 5:03:05 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
As a matter of fact you do have to log in to access it.

So should I change the URL to:

http://hd.alro.com/login...icketView.aspx?ID=218478
Jim
#10 Posted : Friday, August 7, 2015 5:13:44 PM
Rank: Advanced Member

Groups: Administrators, Registered

Joined: 8/13/2004
Posts: 2,667
Location: Canada
That would work for crawling but I don't think it's good for incremental indexing.

Instead change your code to

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


what that does is get the login cookie, which will be used in subsequent requests.

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


cmpenney
#11 Posted : Friday, August 7, 2015 5:23:08 PM
Rank: Newbie

Groups: Registered

Joined: 8/6/2015
Posts: 6
Location: Michigan, USA
That did it!
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.