Skip to content

Commit

Permalink
chore: prepares for v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
micheleriva committed Aug 27, 2022
1 parent 7ac10ee commit 6094fcc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ get-imdb-dataset.mjs
**/dist/**
**/tap-snapshots/**
**/datasets/*.json
*.vue
*.vue
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,35 @@ insert(db, {
});
```

Please note that the `insert` function is synchronous. If you have a large
number of documents, we highly recommend using the `insertBatch` function
instead, which prevents the event loop from blocking. This operation is
asynchronous and returns a promise:

```js
await insertBatch(db, [
{
quote:
"It is during our darkest moments that we must focus to see the light.",
author: "Aristotle",
},
{
quote:
"If you really look closely, most overnight successes took a long time.",
author: "Steve Jobs",
},
{
quote:
"If you are not willing to risk the usual, you will have to settle for the ordinary.",
author: "Jim Rohn",
},
{
quote: "You miss 100% of the shots you don't take",
author: "Wayne Gretzky - Michael Scott",
},
]);
```

After the data has been inserted, you can finally start to query the database.

```js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lyrasearch/lyra",
"version": "0.1.3",
"version": "0.1.4",
"description": "Fast, in-memory, typo-tolerant, full-text search engine written in TypeScript",
"main": "./dist/cjs/lyra.js",
"module": "./dist/esm/lyra.js",
Expand Down

0 comments on commit 6094fcc

Please sign in to comment.