Javascript standalone HTML indexing

I posed a similar question before, but I don’t think I explained my requirements very clearly. Basically, I have a .NET application that writes a bunch of HTML files ... I also want this application to index these HTML files for full-text search so that the javascript code in the HTML files can query the index (based on search queries entered by a user viewing offline files in a web browser).

The idea is to create it all and then copy it onto something like a flash drive or a CD to distribute them for viewing on a device with a web browser, but not necessarily access to the Internet.

I used Apache Solr to prove the concept, but for this you need to start the web server.

The closest I came to is JSSindex (jssindex.sourceforge.net), which uses Lush, but our users' environment is Windows, and we don’t want them to install Cygwin.

+3
source share
3 answers

It looks like your main problem is making the index available local HTML. Trick the way to do this: put the index in the JS file and access the HTML pages.

var index=[ {word:"home", files:["f.html", "bb.html"]},....];
+2
source

Ladders , . 1000 , , ... , , JS - . () , (HTML-), back-end ( ).

+1

trie - - .

, . , , , .

:

  • .net ( ).
  • create your trie structure using an alpha sorted keyword list,
  • decorate terminal nodes with information about documents in which words that they represent can be found.

      C
     A
    R  T [{docid,[hit offsets]},...]
    

You do not need to save offsets, but this will allow you to search for words by proximity or order.

Your .net guys could create sample code.

It will take some time to create the map, but as soon as it is done and you serialize it into JSON, your javascript application will go through it.

0
source

All Articles