This project has moved and is read-only. For the latest updates, please go here.

How to implement a local Search?

Topics: User Forum
May 24, 2007 at 5:17 PM
Edited May 24, 2007 at 5:17 PM
First of all: excellent work!
I'm missing a search function, like in Robohelp, encapsulated in TOC. Any way to implement it? I found DocProject, but Vs2005 give me an error....
May 24, 2007 at 8:07 PM
I assume you're talking about the website output as the HTML help has search built in. Currently, the website output doesn't support searching. It's on the To Do list but I haven't gotten to it yet.

May 31, 2007 at 12:05 AM
Edited May 31, 2007 at 3:55 PM
Well, finally I linked in webpages (using footer and header) the compiled chm file, obviously built before the webpages, without any link.
Jun 3, 2010 at 3:42 PM
Did this ever get implemented? I ask because the site help does contain search functionality, as shown on the Table of Contents here : I certainly do understand if this was just implemented there, but I figured it wouldn't hurt to ask. Also, I assume this question on StackOverflow to be the same:
Jun 3, 2010 at 4:09 PM

The Index.aspx main page supports basic keyword searching.  Click the magnifying glass icon at the top of the TOC pane.  The Index.htm main page does not support searching.



Jun 19, 2010 at 6:43 PM

I'm not sure what you meant by the "local". Do you mean opening the Index.htm directly (from filesystem) in the browser? It would be tricky because there would be no web server running the searching code there and what you have at hand would be only browsing scripting.

What is the scenario you want to make the documentation browsable in? Maybe you could use a convenient solution like I did. Let me explain it.

The only SHFB output target where searching is not available is the website output in the pure HTML (Index.htm). All the others support it (ASPX, CHM, HxS). What scenarios is the Index.htm meant for? To open the documentation locally from the filesystem or publish on a web server without ASP.NET. Luckily, I covered the first scenario by the CHM and the second one by enhancing the output of the SHFB a little. If you want to put your documentation on web without an ASP.NET server, that would be it.

I implemented the keyword index (KI) in javascript. I didn't promote it much because the implementation is very simple, causing the initial loading of the keyword list slow and thus making the ASP.NET version better. Otherwise the UI and behavior is the same like the aspx version. If you are interested I could make it public. (Basically, I made the Index.htm loading both TOC and KI on demand by AJAX calls. Then I implemented the KI browsing in javascript.)

Search was trickier because loading the full-text index to the browser and search through it would be too slow - even if it would be done only initially and then read from the cache. I actually ended up having the magnifying glass icon next to exercise book icon to complete the functionality, but the searching was not standalone like the KI - I integrated the fulltext search engine available on the web server by a custom javascript code.

   --- Ferda