Skip to content

Commit

Permalink
Added disableTypoToleranceOn & altCorrections index settings
Browse files Browse the repository at this point in the history
  • Loading branch information
speedblue committed Jul 2, 2014
1 parent bad33da commit f6d54d4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ For example `"customRanking" => ["desc(population)", "asc(name)"]`
* **placeholders**: (hash of array of words). This is an advanced use case to define a token substitutable by a list of words without having the original token searchable. It is defined by a hash associating placeholders to lists of substitutable words. For example `"placeholders": { "<streetnumber>": ["1", "2", "3", ..., "9999"]}` placeholder to be able to match all street numbers (we use the `< >` tag syntax to define placeholders in an attribute). For example:
* Push a record with the placeholder: `{ "name" : "Apple Store", "address" : "&lt;streetnumber&gt; Opera street, Paris" }`
* Configure the placeholder in your index settings: `"placeholders": { "<streetnumber>" : ["1", "2", "3", "4", "5", ... ], ... }`.
* **disableTypoToleranceOn**: (string array). Specify a list of words on which the automatic typo tolerance will be disabled.
* **altCorrections**: (object array). Specify alternative corrections that you want to consider. Each alternative correction is described by an object containing three attributes:
* **word**: the word to correct
* **correction**: the corrected word
* **nbTypos** the number of typos (1 or 2) that will be considered for the ranking algorithm (1 typo is better than 2 typos)

For example `"altCorrections": [ { "word" : "foot", "correction": "feet", "nbTypos": 1}, { "word": "feet", "correction": "foot", "nbTypos": 1}].`

#### Default query parameters (can be overwrite by query)
* **minWordSizefor1Typo**: (integer) the minimum number of characters to accept one typo (default = 3).
Expand Down

0 comments on commit f6d54d4

Please sign in to comment.