Skip to content

Commit 82eed5d

Browse files
committed
new tokenizer "tolerant"
1 parent db56fa1 commit 82eed5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5463
-5139
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
### Current Version
44

5+
- Calling `index.clear()` on a persistent Index does not stack to the task queue by default (which executes on commit), instead it will execute immediately and return a Promise
6+
- Added new tokenizer `tolerant`, inherits from `strict` but also matches simple typos like missing letters and swapped letters
7+
- Improved Redis Cleanup
58
- Resolver: Support Result Highlighting
69

710
### v0.8.2

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ index.remove(0).update(1, 'foo').add(2, 'foobar');
11711171
<td>tokenize</td>
11721172
<td>
11731173
"strict" / "exact"<br>
1174+
"tolerant"<br>
11741175
"forward"<br>
11751176
"reverse" / "bidirectional<br>
11761177
"full"
@@ -1434,6 +1435,13 @@ Try to choose the most upper of these tokenizer which covers your requirements:
14341435
<td>2n - 1</td>
14351436
</tr>
14361437
<tr></tr>
1438+
<tr>
1439+
<td><code>"tolerant"</code></td>
1440+
<td>index the full term by also being tolerant against typos like swapped letters and missing letters</td>
1441+
<td><code>foobra</code><br><code>foboar</code><br><code>foobr</code><br><code>fooba</code></td>
1442+
<td>1 + 2(n - 2)</td>
1443+
</tr>
1444+
<tr></tr>
14371445
<tr>
14381446
<td><code>"full"</code></td>
14391447
<td>index every consecutive partial</td>
@@ -1510,9 +1518,9 @@ Encoding is one of the most important task and heavily influence:
15101518

15111519
FlexSearch provides several methods to achieve fuzziness to make queries more tolerant:
15121520

1513-
1. Use a tokenizer: `forward`, `reverse` or `full`
1514-
2. Don't forget to use any of the builtin encoder `simple` > `balance` > `advanced` > `extra` > `soundex` (sorted by fuzziness)
1515-
3. Use one of the language specific presets e.g. `/lang/en.js` for en-US specific content
1521+
1. Use a tokenizer: `tolerant`, `forward`, `reverse` or `full`
1522+
2. Consider using any of the builtin encoder `normalize` > `balance` > `advanced` > `extra` > `soundex` (sorted by fuzziness)
1523+
3. Use one of the language-specific presets e.g. `/lang/en.js` for en-US specific content
15161524
4. Enable suggestions by passing the search option `suggest: true`
15171525

15181526
Additionally, you can apply custom `Mapper`, `Replacer`, `Stemmer`, `Filter` or by assigning a custom `normalize(str)`, `prepare(str)` or `finalize(arr)` function to the Encoder.

0 commit comments

Comments
 (0)