Skip to content

Commit c688936

Browse files
authored
fix(demo), docs: Update readme, minor demo fix, and version bump to 1.0.1 (#5)
* fix(demo): fill matches table for more than 10 matches * docs: fix topN docstring * docs: add description of the query parameters * chore(package): bump version to 1.0.1
1 parent ccc4e81 commit c688936

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

demo/fuzzy-demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ function renderMatches(matches, searchDataConfig) {
509509
}
510510

511511
function fillTableWithMatches(matches, searchDataConfig) {
512-
for (let i = 0; i < matches.length; i++) {
512+
for (let i = 0; i < Math.min(matches.length, 10); i++) {
513513
let row = tableBody.children[i];
514514
row.match = matches[i];
515515
row.children[1].textContent = searchDataConfig.getEntityString(matches[i].entity);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@m31coding/fuzzy-search",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "MIT",
55
"description": "A fast, accurate and multilingual fuzzy search library.",
66
"homepage": "https://github.com/m31coding/fuzzy-search",

readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ console.dir(result2);
163163
} */
164164
```
165165

166+
The following parameters are available when creating a query:
167+
168+
| Parameter | Type | Default | Description |
169+
| --------- | ---- | ------- | ----------- |
170+
| string | string | - | The query string. |
171+
| topN | number | 10 | The maximum number of matches to return. Provide Infinity to return all matches. |
172+
| minQuality | number | 0.3 | The minimum quality of a match, ranging from 0 to 1. When set to zero, all terms that share at least one common n-gram with the query are considered a match. |
173+
166174
If the data terms contain characters and strings in non-latin scripts (such as Arabic, Cyrillic, Greek, Han, ... see also [ISO 15924](https://en.wikipedia.org/wiki/ISO_15924)), the default configuration must be adjusted before creating the searcher:
167175

168176
```js

src/interfaces/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class Query {
88
public readonly string: string;
99

1010
/**
11-
* The maximum number of matches to return. If undefined, all matches will be returned.
11+
* The maximum number of matches to return. Provide Infinity to return all matches.
1212
*/
1313
public readonly topN: number;
1414

0 commit comments

Comments
 (0)