Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs, minor fix, and version bump to 1.0.1 #5

Merged
merged 4 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/fuzzy-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function renderMatches(matches, searchDataConfig) {
}

function fillTableWithMatches(matches, searchDataConfig) {
for (let i = 0; i < matches.length; i++) {
for (let i = 0; i < Math.min(matches.length, 10); i++) {
let row = tableBody.children[i];
row.match = matches[i];
row.children[1].textContent = searchDataConfig.getEntityString(matches[i].entity);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@m31coding/fuzzy-search",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"description": "A fast, accurate and multilingual fuzzy search library.",
"homepage": "https://github.com/m31coding/fuzzy-search",
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ console.dir(result2);
} */
```

The following parameters are available when creating a query:

| Parameter | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| string | string | - | The query string. |
| topN | number | 10 | The maximum number of matches to return. Provide Infinity to return all matches. |
| 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. |

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:

```js
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Query {
public readonly string: string;

/**
* The maximum number of matches to return. If undefined, all matches will be returned.
* The maximum number of matches to return. Provide Infinity to return all matches.
*/
public readonly topN: number;

Expand Down