admin管理员组

文章数量:1357602

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.

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.

Share Improve this question asked Apr 14, 2014 at 10:44 Raphaël LemaireRaphaël Lemaire 1,3091 gold badge13 silver badges23 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

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

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

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.

本文标签: Client side javascript equivalent to LuceneStack Overflow