javascriptfuzzy-search

JavaScript/List.js: Implement a fuzzy search


I'm working on this filtering thing where I have about 50-100 list items. And each item has 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>

I created markup like this because I initially used List.js.

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.

As I have a fairly small amount of items, I would like a client side solution.


Solution

  • One year later, List.js got a nice plugin for fuzzy search that works pretty great.