5

Possible Duplicate:
Full-text search for static HTML files on CD-Rom via javascript

I'm starting development of an application that creates a bunch of HTML files locally that can then be browsed in whatever web browser is on the system (including mobile devices) to which they're copied. The HTML files have many interactive features, so it's essentially an offline web app. My question is, what is the best way to implement full-text search for these HTML files? Basically, the application should index the HTML files it generates, but we want to be able to make the HTML files and the generated index downloadable and available for users to browse and search offline. What is the best way to do this without writing an actual application to manage it? For example, I've implemented it using Solr for a demo/proof-of-concept and that works fine ... but of course that requires HTTP POST and GET requests to a server for indexing and querying. So since the indexes are really just files, I'm wondering if there's a way to query them offline (and without firing up a local web server for Solr) using just Javascript in the HTML files, maybe with Lucene instead of Solr?

Community
  • 1
  • 1
user1263226
  • 250
  • 3
  • 12

1 Answers1

1

Thanks for introducing me to a few text search solutions written entirely in Javascript! I wanted to check out code for text search.


Lucene is written in Java and it needs a Java (technically a JVM) process to access.

PS1: If you are rolling your own simple text search, a stemmer in JS will make it more useful.

original: run running cat cats love loving crap crapping
stemmed: run run cat cat love love crap crap 

PS2: You can run another "Ngram-ized" index for spell checking too.


Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202
  • Thanks, if I'm not mistaken the first link is for server-side (?) but the second one looks very interesting, I'll play around with it a little and get back to you – user1263226 Apr 30 '12 at 22:24
  • I saw _"..you can use it in the browser"_ hence I included it too – Jesvin Jose May 01 '12 at 05:01
  • After looking into the Ladders solution some more, it doesn't quite meet my needs, so instead of "accepting" it I just voted it up because it does give me an idea of how to proceed with a custom solution if I don't find a readymade one – user1263226 May 07 '12 at 21:47
  • Sure. But do post me a link if you come up with another interesting question, Im also interested in info stores like wikis – Jesvin Jose May 08 '12 at 04:49