JavaScript模糊搜索 [英] JavaScript fuzzy search
问题描述
我正在处理这个过滤的事情,我有大约50-100个列表项。每个项目都有这样的标记:
I'm working on this filtering thing where I have about 50-100 list items. And each items have markup like this:
<li>
<input type="checkbox" name="services[]" value="service_id" />
<span class="name">Restaurant in NY</span>
<span class="filters"><!-- hidden area -->
<span class="city">@city: new york</span>
<span class="region">@reg: ny</span>
<span class="date">@start: 02/05/2012</span>
<span class="price">@price: 100</span>
</span>
</li>
我创建了这样的标记,因为我最初使用了 List.js
I created markup like this because I initally used List.js
所以,你可能已经猜到了,我想要做的是这样的搜索: @region:LA @price:124
等等。问题是我还想显示多个项目,以便选择多于......一个:)
So, probably you guessed already, what I want is to do searches like this:@region: LA @price: 124
and so on. The problem is that i also want to display more than one item, in order to select more than... one :)
我认为这需要模糊搜索,但是问题是我找不到任何功能。
I assume this needs fuzzy search, but the problem is that i didn't find anything functional.
任何想法或起点?
//编辑:因为我的项目数量相当少,我想要一个客户端解决方案。
// edit: because I have a fairly small amount of items, I would like a client side solution.
推荐答案
一年后,List。 js为模糊搜索提供了一个很好的插件,效果非常好。
One year later, List.js got a nice plugin for fuzzy search that works pretty great.
这篇关于JavaScript模糊搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!