Skip to content

Commit

Permalink
Fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirollos Risk committed Apr 8, 2014
1 parent 80c86d2 commit 8443d20
Showing 1 changed file with 11 additions and 31 deletions.
42 changes: 11 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Visit here for usage, demo, and more: [Fuse](http://kiro.me/projects/fuse.html)

## Options

**keys**
*Type*: `Array`
**keys** (*type*: `Array`)

List of properties that will be searched. This also supports nested properties:

Expand All @@ -27,40 +26,31 @@ var fuse = new Fuse(boos, { keys: ["title", "author.firstName"] });

---

**id**
*Type*: `String`
**id** (*type*: `String`)

The string name of the identifier property. If specified, the returned result will be a list of the items' identifiers, otherwise it will be a list of the items.

---

**caseSensitive**
*Type*: `Boolean`
*Default*: `false`
**caseSensitive** (*type*: `Boolean`, *default*: `false`)

Indicates whether comparisons should be case sensitive.

---

**includeScore**
*Type*: `Boolean`
*Default*: `true`
**includeScore** (*type*: `Boolean`, *default*: `true`)

Whether the score should be included in the result set. When `true`, each result in the list will be of the form `{ item: ..., score: ... }`

---

**shouldSort**
*Type*: `Boolean`
*Default*: `true`
**shouldSort** (*type*: `Boolean`, *default*: `true`)

Whether to sort the result list, by score.

---

**searchFn**
*Type*: `Function`
*Default*: `BitapSearcher` (internal)
**searchFn** (*type*: `Function`, *default*: `BitapSearcher`)

The search function to use. Note that the search function (`[[Function]]`) must conform the following API:

Expand All @@ -82,41 +72,31 @@ The search function to use. Note that the search function (`[[Function]]`) must

---

**sortFn**
*Type*: `Function`
*Default*: `Array.prototype.sort`
**sortFn** (*type*: `Function`, *default*: `Array.prototype.sort`)

The function that is used for sorting the result list.

### Bitap specific options

**location**
*Type*: `Integer`
*Default*: `0`
**location** (*type*: `Integer`, *default*: `0`)

Determines approximately where in the text is the pattern expected to be found.

---

**threshold**
*Type*: `Decimal`
*Default*: `0.6`
**threshold** (*type*: `Decimal`, *default*: `0.6`)

At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything.

---

**distance**
*Type*: `Integer`
*Default*: `100`
**distance** (*type*: `Integer`, *default*: `100`)

Determines how close the match must be to the fuzzy location (specified by `location`). An exact letter match which is `distance` characters away from the fuzzy location would score as a complete mismatch. A `distance` of `0` requires the match be at the exact `location` specified, a `threshold` of `1000` would require a perfect match to be within 800 characters of the `location` to be found using a `threshold` of `0.8`.

---

**maxPatternLength**
*Type*: `Integer`
*Default*: `32`
**maxPatternLength** (*type*: `Integer`, *default*: `32`)

The maximum length of the pattern. The longer the pattern, the more intensive the search operation will be. Whenever the pattern exceeds the `maxPatternLength`, an error will be thrown. Why is this important? Read [this](http://en.wikipedia.org/wiki/Word_(computer_architecture)#Word_size_choice).

Expand Down

0 comments on commit 8443d20

Please sign in to comment.