From 7c64745604737d5ab2750393da4d48f84d720e0c Mon Sep 17 00:00:00 2001 From: Thomas Wilkerling Date: Mon, 8 Jan 2024 02:29:20 +0100 Subject: [PATCH] update readme --- README.md | 115 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 63 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index fd63f60..37d62f1 100644 --- a/README.md +++ b/README.md @@ -44,20 +44,6 @@ I'm really happy that FlexSearch is getting so much positive feedback and also f Thanks a lot, Thomas (ts-thomas) - -

When it comes to raw search speed FlexSearch outperforms every single searching library out there and also provides flexible search capabilities like multi-field search, phonetic transformations or partial matching. @@ -65,11 +51,6 @@ When it comes to raw search speed options it also provides the most memory-efficient index. FlexSearch introduce a new scoring algorithm called "contextual index" based on a pre-scored lexical dictionary architecture which actually performs queries up to 1,000,000 times faster compared to other libraries. FlexSearch also provides you a non-blocking asynchronous processing model as well as web workers to perform any updates or queries on the index in parallel through dedicated balanced threads. - - Supported Platforms: - Browser - Node.js @@ -89,7 +70,7 @@ Plugins (extern projects): - Vue: https://github.com/Noction/vue-use-flexsearch - Gatsby: https://www.gatsbyjs.org/packages/gatsby-plugin-flexsearch/ -### Get Latest Stable Build (Recommended) +### Get Latest @@ -137,10 +118,6 @@ Plugins (extern projects): npm install flexsearch ``` -#### Get Latest Nightly (Do not use for production!) - -Just exchange the version number from the URLs above with "master", e.g.: "/flexsearch/__0.7.31__/dist/" into "/flexsearch/__master__/dist". - ### Compare Web-Bundles > The Node.js package includes all features from `flexsearch.bundle.js`. @@ -447,45 +424,69 @@ There are 3 types of indexes: The most of you probably need just one of them according to your scenario. -### ESM / ES6 Modules (Browser): +### Browser -```js -import Index from "flexsearch/dist/module"; -import Worker from "flexsearch/dist/module/worker"; -import Document from "flexsearch/dist/module/document"; - -const index = new Index(options); -const document = new Document(options); -const worker = new WorkerIndex(options); -``` - -### Bundle (Browser) +#### Legacy ES5 Script Tag (Bundled) ```html - - - - -... + + +``` + +### ESM/ES6 Modules: + +```html + +``` + +#### ESM/ES6 Bundled Module: + +```html + ``` Or via CDN: ```html - + ``` -AMD: +AMD / CommonJS: ```javascript -var FlexSearch = require("./flexsearch.js"); -``` - -Load one of the builds from the folder dist within your html as a script and use as follows: - -```js -var index = new FlexSearch.Index(options); -var document = new FlexSearch.Document(options); -var worker = new FlexSearch.Worker(options); +var FlexSearch = require("./node_modules/flexsearch/dist/flexsearch.bundle.min.js"); ``` ### Node.js @@ -504,6 +505,16 @@ const document = new Document(options); const worker = new Worker(options); ``` +Or: + +```js +const FlexSearch = require("flexsearch"); + +const index = new FlexSearch.Index(options); +const document = new FlexSearch.Document(options); +const worker = new FlexSearch.Worker(options); +``` + ## Basic Usage and Variants ```js