Client side javascript equivalent to Lucene

喜你入骨 提交于 2019-12-24 12:34:47

问题


I was wondering if there's a Javascript equivalent to the Lucene API, designed to be used on client side to index a relatively small data set.

An example use case would be a static site (generated for instance) with the ability to search content without server side processing.


回答1:


I've found this : http://lunrjs.com/ It looks like what I'm searching for but doesn't seem to support fuzzy searches.




回答2:


Theoretically, you could use Search-index in conjunction with node-browserify or another similar hack. Practically, I doubt this effort is worth pursuing.




回答3:


You also have search-index as @mindas mentions. Lunr is more mature, and easier to get up and runnig, but search-index is maybe more feature rich? As with lunr, you'll need to do stemming on the data you want to index and/or use the matcher. The matcher does prefix search and returns words and/or phrases that is present in your document index.

I'm biased, but I think it's now wort the effort to use search-index. There are now some examples on how to use it client side with browserify.



来源:https://stackoverflow.com/questions/23058056/client-side-javascript-equivalent-to-lucene

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