How to create client side full text search engine with pure JavaScript and HTML5?

荒凉一梦 提交于 2019-12-02 17:35:07

Reyes is doing a fulltext search engine for this exact purpose : https://github.com/reyesr/fullproof

During last september Paris JS, he did a presentation of the concepts behind : http://kornr.net/prez/paris.js22/#/

Hope it answers your need.

vanthome

I think meanwhile lunr.js must be considered. It has 3-times the stars on Github.

Saving whole database in .json file definitely wouldn't be efficient, but splitting your database to chunks and saving them as .json files loaded on demand may work just fine - it would require testing though.

And - MongoDB stores database in BSON. You can also think about storing your database in this file format and loading it from your application (I would suggest splitting the whole database to smaller parts anyway).

// edit - If you're going to give away the database as file, then I don't think that it's possible to set any kind of permissions. You could try to encrypt/obfuscate the file, but I have no idea how would that affect the performance or database' contents.

And yes, it is possible to have a standalone html+js application that would read the BSON database without any kind of server. Check this link if you want to know more. I've heard of this before, but I have completely no experience when it comes to handling BSON files in pure JS, so I can't help you out with this. All I could do was to let you know that such a thing exists :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!