Forum Moderators: open
We run a magazine site.
We would like to release all of the articles in one CD, which is easy enough to do.
However, we'd like the CD to have search functionalities (that is, do a full text search on the article's contents) without using Flash. Please bear in mind that there is no web server involved!
Does anybody know if it's possible to do so using Javascript?
We would need two modules: the first one would be the "indexer". This one could be written in any language, really.
The second one would be the "search", which would have to read the index files created by the indexer and return the results.
My main worry is that normally Javascript can't access locally stored files... is there a way around that?
Does anybody know if this has been done before? Is there any code available anywhere?
Thanks a lot,
Merc.
Dump your content into a Javascript array and search that. Have the location of the page in one element of the array and the content in another.
Google : javascript search in files
There is one problem: there are over 250 files, and each one contains an article. I very much doubt you could put everything in RAM.
I would have to create a list of words, and for each word I would have to store which file it's in, and then create a "search" algotirhm that finds out where the word you're looking for is.
Does it sound doable? Can I store this information on a file?
Merc.
The 'tool' ignores all the tags and indexes just the basic text. The same tool is also capable of building a server-side index too (I think) if you wish.
The resulting .js file is 600KB+ (!) But if run locally (or from a CD) it works great, and caches nicely.