Full Code of nextapps-de/flexsearch for AI

master defb38b083f0 cached
434 files
3.6 MB
963.2k tokens
1035 symbols
1 requests
Download .txt
Showing preview only (3,844K chars total). Download the full file or copy to clipboard to get everything.
Repository: nextapps-de/flexsearch
Branch: master
Commit: defb38b083f0
Files: 434
Total size: 3.6 MB

Directory structure:
gitextract_4puswicl/

├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── node.js.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── SECURITY.md
├── demo/
│   ├── autocomplete.html
│   └── data/
│       ├── gulliver.js
│       └── movies.js
├── dist/
│   ├── db/
│   │   ├── clickhouse/
│   │   │   └── index.cjs
│   │   ├── indexeddb/
│   │   │   └── index.cjs
│   │   ├── mongodb/
│   │   │   └── index.cjs
│   │   ├── postgres/
│   │   │   └── index.cjs
│   │   ├── redis/
│   │   │   └── index.cjs
│   │   └── sqlite/
│   │       └── index.cjs
│   ├── flexsearch.bundle.debug.js
│   ├── flexsearch.bundle.module.debug.js
│   ├── flexsearch.bundle.module.debug.mjs
│   ├── flexsearch.bundle.module.min.mjs
│   ├── flexsearch.compact.debug.js
│   ├── flexsearch.compact.module.debug.js
│   ├── flexsearch.es5.debug.js
│   ├── flexsearch.light.debug.js
│   ├── flexsearch.light.module.debug.js
│   ├── module/
│   │   ├── async.js
│   │   ├── bundle.js
│   │   ├── cache.js
│   │   ├── charset/
│   │   │   ├── cjk.js
│   │   │   ├── exact.js
│   │   │   ├── latin/
│   │   │   │   ├── advanced.js
│   │   │   │   ├── balance.js
│   │   │   │   ├── extra.js
│   │   │   │   └── soundex.js
│   │   │   ├── normalize.js
│   │   │   └── polyfill.js
│   │   ├── charset.js
│   │   ├── common.js
│   │   ├── compress.js
│   │   ├── db/
│   │   │   ├── clickhouse/
│   │   │   │   └── index.js
│   │   │   ├── indexeddb/
│   │   │   │   └── index.js
│   │   │   ├── interface.js
│   │   │   ├── mongodb/
│   │   │   │   └── index.js
│   │   │   ├── postgres/
│   │   │   │   └── index.js
│   │   │   ├── redis/
│   │   │   │   └── index.js
│   │   │   └── sqlite/
│   │   │       └── index.js
│   │   ├── document/
│   │   │   ├── add.js
│   │   │   ├── highlight.js
│   │   │   └── search.js
│   │   ├── document.js
│   │   ├── encoder.js
│   │   ├── index/
│   │   │   ├── add.js
│   │   │   ├── remove.js
│   │   │   └── search.js
│   │   ├── index.js
│   │   ├── intersect.js
│   │   ├── keystore.js
│   │   ├── lang/
│   │   │   ├── de.js
│   │   │   ├── en.js
│   │   │   └── fr.js
│   │   ├── preset.js
│   │   ├── profiler.js
│   │   ├── resolve/
│   │   │   ├── and.js
│   │   │   ├── default.js
│   │   │   ├── handler.js
│   │   │   ├── not.js
│   │   │   ├── or.js
│   │   │   └── xor.js
│   │   ├── resolver.js
│   │   ├── serialize.js
│   │   ├── type.js
│   │   ├── worker/
│   │   │   ├── handler.js
│   │   │   ├── node.js
│   │   │   └── worker.js
│   │   └── worker.js
│   ├── module-debug/
│   │   ├── async.js
│   │   ├── bundle.js
│   │   ├── cache.js
│   │   ├── charset/
│   │   │   ├── cjk.js
│   │   │   ├── exact.js
│   │   │   ├── latin/
│   │   │   │   ├── advanced.js
│   │   │   │   ├── balance.js
│   │   │   │   ├── extra.js
│   │   │   │   └── soundex.js
│   │   │   ├── normalize.js
│   │   │   └── polyfill.js
│   │   ├── charset.js
│   │   ├── common.js
│   │   ├── compress.js
│   │   ├── db/
│   │   │   ├── clickhouse/
│   │   │   │   └── index.js
│   │   │   ├── indexeddb/
│   │   │   │   └── index.js
│   │   │   ├── interface.js
│   │   │   ├── mongodb/
│   │   │   │   └── index.js
│   │   │   ├── postgres/
│   │   │   │   └── index.js
│   │   │   ├── redis/
│   │   │   │   └── index.js
│   │   │   └── sqlite/
│   │   │       └── index.js
│   │   ├── document/
│   │   │   ├── add.js
│   │   │   ├── highlight.js
│   │   │   └── search.js
│   │   ├── document.js
│   │   ├── encoder.js
│   │   ├── index/
│   │   │   ├── add.js
│   │   │   ├── remove.js
│   │   │   └── search.js
│   │   ├── index.js
│   │   ├── intersect.js
│   │   ├── keystore.js
│   │   ├── lang/
│   │   │   ├── de.js
│   │   │   ├── en.js
│   │   │   └── fr.js
│   │   ├── preset.js
│   │   ├── profiler.js
│   │   ├── resolve/
│   │   │   ├── and.js
│   │   │   ├── default.js
│   │   │   ├── handler.js
│   │   │   ├── not.js
│   │   │   ├── or.js
│   │   │   └── xor.js
│   │   ├── resolver.js
│   │   ├── serialize.js
│   │   ├── type.js
│   │   ├── worker/
│   │   │   ├── handler.js
│   │   │   ├── node.js
│   │   │   └── worker.js
│   │   └── worker.js
│   └── module-min/
│       ├── async.js
│       ├── bundle.js
│       ├── cache.js
│       ├── charset/
│       │   ├── cjk.js
│       │   ├── exact.js
│       │   ├── latin/
│       │   │   ├── advanced.js
│       │   │   ├── balance.js
│       │   │   ├── extra.js
│       │   │   └── soundex.js
│       │   ├── normalize.js
│       │   └── polyfill.js
│       ├── charset.js
│       ├── common.js
│       ├── compress.js
│       ├── db/
│       │   ├── clickhouse/
│       │   │   └── index.js
│       │   ├── indexeddb/
│       │   │   └── index.js
│       │   ├── interface.js
│       │   ├── mongodb/
│       │   │   └── index.js
│       │   ├── postgres/
│       │   │   └── index.js
│       │   ├── redis/
│       │   │   └── index.js
│       │   └── sqlite/
│       │       └── index.js
│       ├── document/
│       │   ├── add.js
│       │   ├── highlight.js
│       │   └── search.js
│       ├── document.js
│       ├── encoder.js
│       ├── index/
│       │   ├── add.js
│       │   ├── remove.js
│       │   └── search.js
│       ├── index.js
│       ├── intersect.js
│       ├── keystore.js
│       ├── lang/
│       │   ├── de.js
│       │   ├── en.js
│       │   └── fr.js
│       ├── preset.js
│       ├── profiler.js
│       ├── resolve/
│       │   ├── and.js
│       │   ├── default.js
│       │   ├── handler.js
│       │   ├── not.js
│       │   ├── or.js
│       │   └── xor.js
│       ├── resolver.js
│       ├── serialize.js
│       ├── type.js
│       ├── worker/
│       │   ├── handler.js
│       │   ├── node.js
│       │   └── worker.js
│       └── worker.js
├── doc/
│   ├── async.md
│   ├── custom-builds.md
│   ├── customization.md
│   ├── document-search.md
│   ├── encoder.md
│   ├── export-import.md
│   ├── keystore.md
│   ├── persistent-clickhouse.md
│   ├── persistent-indexeddb.md
│   ├── persistent-mongodb.md
│   ├── persistent-postgres.md
│   ├── persistent-redis.md
│   ├── persistent-sqlite.md
│   ├── persistent.md
│   ├── resolver.md
│   ├── result-highlighting.md
│   └── worker.md
├── docker-compose.yml
├── example/
│   ├── browser-legacy/
│   │   ├── basic/
│   │   │   └── index.html
│   │   ├── basic-persistent/
│   │   │   └── index.html
│   │   ├── basic-resolver/
│   │   │   └── index.html
│   │   ├── basic-suggestion/
│   │   │   └── index.html
│   │   ├── basic-worker/
│   │   │   └── index.html
│   │   ├── document/
│   │   │   └── index.html
│   │   ├── document-highlighting/
│   │   │   └── index.html
│   │   ├── document-persistent/
│   │   │   └── index.html
│   │   ├── document-resolver/
│   │   │   └── index.html
│   │   ├── document-worker/
│   │   │   └── index.html
│   │   └── language-pack/
│   │       └── index.html
│   ├── browser-module/
│   │   ├── basic/
│   │   │   └── index.html
│   │   ├── basic-persistent/
│   │   │   └── index.html
│   │   ├── basic-resolver/
│   │   │   └── index.html
│   │   ├── basic-suggestion/
│   │   │   └── index.html
│   │   ├── basic-worker/
│   │   │   └── index.html
│   │   ├── basic-worker-extern-config/
│   │   │   ├── config.js
│   │   │   └── index.html
│   │   ├── document/
│   │   │   └── index.html
│   │   ├── document-highlighting/
│   │   │   └── index.html
│   │   ├── document-persistent/
│   │   │   └── index.html
│   │   ├── document-resolver/
│   │   │   └── index.html
│   │   ├── document-worker/
│   │   │   └── index.html
│   │   ├── document-worker-extern-config/
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   └── index.html
│   │   └── language-pack/
│   │       └── index.html
│   ├── nodejs-commonjs/
│   │   ├── .document-worker-persistent/
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-export-import/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-persistent/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-resolver/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-suggestion/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker-export-import/
│   │   │   ├── config.js
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker-extern-config/
│   │   │   ├── config.js
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-export-import/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-persistent/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-resolver/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker-export-import/
│   │   │   ├── README.md
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker-extern-config/
│   │   │   ├── README.md
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   └── language-pack/
│   │       ├── README.md
│   │       ├── index.js
│   │       └── package.json
│   └── nodejs-esm/
│       ├── basic/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-export-import/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-persistent/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-resolver/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-suggestion/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker-export-import/
│       │   ├── config.js
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker-extern-config/
│       │   ├── README.md
│       │   ├── config.js
│       │   ├── index.js
│       │   └── package.json
│       ├── document/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-export-import/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-persistent/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-resolver/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker-export-import/
│       │   ├── README.md
│       │   ├── config.originalTitle.js
│       │   ├── config.primaryTitle.js
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker-extern-config/
│       │   ├── README.md
│       │   ├── config.originalTitle.js
│       │   ├── config.primaryTitle.js
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       └── language-pack/
│           ├── README.md
│           ├── index.js
│           └── package.json
├── index.d.ts
├── package.json
├── src/
│   ├── async.js
│   ├── bundle.js
│   ├── cache.js
│   ├── charset/
│   │   ├── cjk.js
│   │   ├── exact.js
│   │   ├── latin/
│   │   │   ├── advanced.js
│   │   │   ├── balance.js
│   │   │   ├── extra.js
│   │   │   └── soundex.js
│   │   ├── normalize.js
│   │   └── polyfill.js
│   ├── charset.js
│   ├── common.js
│   ├── compress.js
│   ├── config.js
│   ├── db/
│   │   ├── clickhouse/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── indexeddb/
│   │   │   └── index.js
│   │   ├── interface.js
│   │   ├── mongodb/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── postgres/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── redis/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   └── sqlite/
│   │       ├── index.js
│   │       └── package.json
│   ├── document/
│   │   ├── add.js
│   │   ├── highlight.js
│   │   └── search.js
│   ├── document.js
│   ├── encoder.js
│   ├── index/
│   │   ├── add.js
│   │   ├── remove.js
│   │   └── search.js
│   ├── index.js
│   ├── intersect.js
│   ├── keystore.js
│   ├── lang/
│   │   ├── de.js
│   │   ├── en.js
│   │   └── fr.js
│   ├── preset.js
│   ├── profiler.js
│   ├── resolve/
│   │   ├── and.js
│   │   ├── default.js
│   │   ├── handler.js
│   │   ├── not.js
│   │   ├── or.js
│   │   └── xor.js
│   ├── resolver.js
│   ├── serialize.js
│   ├── type.js
│   ├── worker/
│   │   ├── handler.js
│   │   ├── node.js
│   │   ├── node.mjs
│   │   └── worker.js
│   └── worker.js
├── task/
│   ├── babel.bundle.json
│   ├── babel.debug.json
│   ├── babel.js
│   ├── babel.min.json
│   └── build.js
└── test/
    ├── .c8rc.json
    ├── async.js
    ├── basic.js
    ├── cache.js
    ├── context.js
    ├── debug.js
    ├── document.js
    ├── document.tag.js
    ├── encoder.js
    ├── highlight.js
    ├── issues.js
    ├── keystore.js
    ├── misc/
    │   ├── reporter.js
    │   └── runner.js
    ├── package.json
    ├── persistent.clickhouse.js
    ├── persistent.js
    ├── persistent.mongo.js
    ├── persistent.postgres.js
    ├── persistent.redis.js
    ├── persistent.sqlite.js
    ├── resolver.js
    ├── scoring.js
    ├── serialize.js
    ├── tokenize.js
    ├── types.ts
    └── worker.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
index.html -linguist-detectable
bench/** -linguist-detectable
dist/** -linguist-detectable
doc/** -linguist-detectable
test/** -linguist-detectable
demo/** -linguist-detectable
task/** -linguist-detectable


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: [ts-thomas]
open_collective: flexsearch
liberapay: ts-thomas
patreon: user?u=96245532
custom: ["https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW", "https://salt.bountysource.com/teams/ts-thomas"]


================================================
FILE: .github/workflows/node.js.yml
================================================
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

permissions:
  contents: read
  pull-requests: write

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  # Label of the container job
  build:
    # Containers must run in Linux based operating systems
    runs-on: ubuntu-latest
    timeout-minutes: 10

#    # Docker Hub image that `container-job` executes in
#    container: node:20-bookworm-slim
#
#    # Service containers to run with `container-job`
#    services:
#      # Label used to access the service container
#      postgres:
#        # Docker Hub image
#        image: postgres
#        # Provide the password for postgres
#        env:
#          POSTGRES_USER: postgres
#          POSTGRES_PASSWORD: postgres
#          POSTGRES_DATABASE: postgres
#          POSTGRES_HOST: postgres
#          POSTGRES_PORT: 5432
#
#        # Set health checks to wait until postgres has started
#        options: >-
#          --health-cmd pg_isready
#          --health-interval 10s
#          --health-timeout 5s
#          --health-retries 5

    strategy:
      matrix:
        node-version: [20.x, 22.x, 24.x] # 18.x
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v4
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v4
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - uses: actions/setup-java@v1
      with:
        java-version: 21
    - run: npm install
    - run: npm run build:compact
    - run: npm run build:module:compact
    - run: npm run build:light
    - run: npm run build:module:light
    - run: npm install
      working-directory: test
    - run: npm run test:github
      working-directory: test


================================================
FILE: .gitignore
================================================
.idea
.nyc_output
.db
!*.keep
coverage
perf
node_modules
server
tmp
log
issue
node


================================================
FILE: CHANGELOG.md
================================================
# Changelog

### Current Version

- 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
- Added new tokenizer `tolerant`, inherits from `strict` but also matches simple typos like missing letters and swapped letters
- Improved Redis Cleanup
- Resolver: Support Result Highlighting

### v0.8.2

- Config-Serialized Query Caches, Improved caching strategy for Document indexes and Resolver
- Resolver Async Processing Workflow (including Queuing)
- Extended Resolver Support: Worker, Persistent, Cache
- Extended Result Highlighting: Boundaries, Ellipsis, Alignment
- Improved TypeScript Typings
- Improved Stemmer Handling
- Improved Result Highlighting
- Use multi-language charset normalization as the default `Encoder`
- Simplified charset support for multi-language content
- Charset renamed `LatinExact` => `Exact`, `LatinDefault` => `Default` and `LatinSimple` => `Normalize`, these are universal charset presets for any languages
- Charset `ArabicDefault` and `CyrillicDefault` was removed, they are fully covered by the default universal charset presets
- Charset `Charset.CjkDefault` was renamed to `Charset.CJK`

### v0.8.1

- Resolver Support for Documents
- Asynchronous Runtime Balancer, new option `priority`
- Export/Import Worker Indexes + Document Worker, new extern config options `export` and `import`
- Improved interoperability of the different build packages, including source folder
- Support custom `filter` function for encoder (stop-word filter)

### v0.8.0

- Persistent indexes support for: `IndexedDB` (Browser), `Redis`, `SQLite`, `Postgres`, `MongoDB`, `Clickhouse`
- Enhanced language customization via the new `Encoder` class
- Result Highlighting
- Query performance achieve results up to 4.5 times faster compared to the previous generation v0.7.x by also improving the quality of results
- Enhanced support for larger indexes or larger result sets
- Improved offset and limit processing achieve up to 100 times faster traversal performance through large datasets
- Support for larger In-Memory index with extended key size (the defaults maximum keystore limit is: 2^24)
- Greatly enhanced performance of the whole text encoding pipeline
- Improved indexing of numeric content (Triplets)
- Intermediate result sets and `Resolver`
- Basic Resolver: `and`, `or`, `xor`, `not`, `limit`, `offset`, `boost`, `resolve`
- Improved charset collection
- New charset preset `soundex` which further reduces memory consumption by also increasing "fuzziness"
- Performance gain when polling tasks to the index by using "Event-Loop-Caches"
- Up to 100 times faster deletion/replacement when not using the additional "fastupdate" register
- Regex Pre-Compilation (transforms hundreds of regex rules into just a few)
- Extended support for multiple tags (DocumentIndex)
- Custom Fields ("Virtual Fields")
- Custom Filter
- Custom Score Function
- Added French language preset (stop-word filter, stemmer)
- Enhanced Worker Support
- Export / Import index in chunks
- Improved Build System + Bundler (Supported: CommonJS, ESM, Global Namespace), also the import of language packs are now supported for Node.js
- Full covering index.d.ts type definitions
- Fast-Boot Serialization optimized for Server-Side-Rendering (PHP, Python, Ruby, Rust, Java, Go, Node.js, ...)

### v0.7.0

- Bidirectional Context (the order of words can now vary, does not increase memory when using bidirectional context)
- New memory-friendly strategy for indexes (switchable, saves up to 50% of memory for each index, slightly decrease performance)
- Better scoring calculation (one of the biggest concerns of the old implementation was that the order of arrays processed in the intersection has affected the order of relevance in the final result)
- Fix resolution (the resolution in the old implementation was not fully stretched through the whole range in some cases)
- Skip words (optionally, automatically skip words from the context chain which are too short)
- Hugely improves performance of long queries (up to 450x faster!) and also memory allocation (up to 250x less memory)
- New fast-update strategy (optionally, hugely improves performance of all updates and removals of indexed contents up to 2850x)
- Improved auto-balanced cache (keep and expire cache by popularity)
- Append contents to already existing entries (already indexed documents or contents)
- New method "contain" to check if an ID was already indexed
- Access documents directly from internal store (read/write)
- Suggestions are hugely improved, falls back from context search all the way down to single term match
- Document descriptor has now array support (optionally adds array entries via the new `append` under the hood to provide a unique relevance context for each entry)
- Document storage handler gets improved
- Results from document index now grouped by field (this is one of the few bigger breaking changes which needs migrations of your old code)
- Boolean search has a new concept (use in combination of the new result structure)
- Node.js Worker Threads
- Improved default latin encoders
- New parallelization model and workload distribution
- Improved Export/Import
- Tag Search
- Offset pagination
- Enhanced Field Search
- Improved sorting by relevance (score)
- Added Context Scoring (context index has its own resolution)
- Enhanced charset normalization
- Improved bundler (support for inline WebWorker)

These features have been removed:

- Where-Clause
- Index Information `index.info()`
- Paging Cursor (was replaced by `offset`)

#### Migration Quick Overview

> The "async" options was removed, instead you can call each method in its async version, e.g. `index.addAsync` or `index.searchAsync`.

> Define document fields as object keys is not longer supported due to the unification of all option payloads.

A full configuration example for a context-based index:

```js
var index = new Index({
    tokenize: "strict",
    resolution: 9,
    minlength: 3,
    optimize: true,
    fastupdate: true,
    cache: 100,
    context: {
        depth: 1,
        resolution: 3,
        bidirectional: true
    }
});
```

The `resolution` could be set also for the contextual index.

A full configuration example for a document based index:

```js
const index = new Document({
    tokenize: "forward",
    optimize: true,
    resolution: 9,
    cache: 100,
    worker: true,
    document: {
        id: "id",
        tag: "tag",
        store: [
            "title", "content"
        ],
        index: [{
            field: "title",
            tokenize: "forward",
            optimize: true,
            resolution: 9
        },{
            field:  "content",
            tokenize: "strict",
            optimize: true,
            resolution: 9,
            minlength: 3,
            context: {
                depth: 1,
                resolution: 3
            }
        }]
    }
});
```

A full configuration example for a document search:

```js
index.search({
    enrich: true,
    bool: "and",
    tag: ["cat", "dog"],
    index: [{
        field: "title",
        query: "some query",
        limit: 100,
        suggest: true
    },{
        field: "content",
        query: "same or other query",
        limit: 100,
        suggest: true
    }]
});
```

#### Where Clause Replacement

Old Syntax:

```js
const result = index.where({
    cat: "comedy",
    year: "2018"
});
```

Equivalent Syntax (0.7.x):

```js
const data = Object.values(index.store);
```

The line above retrieves data from the document store (just useful when not already available in your runtime).

```js
const result = data.filter(function(item){ 
    return item.cat === "comedy" && item.year === "2018";
});
```

Also considering using the <a href="https://github.com/nextapps-de/flexsearch#tags">Tag-Search</a> feature, which partially replaces the Where-Clause with a huge performance boost.

### v0.6.0

- Pagination

### v0.5.3

- Logical Operator

### v0.5.2

- Intersect Partial Results

### v0.5.1

- Customizable Scoring Resolution

### v0.5.0

- Where / Find Documents
- Document Tags
- Custom Sort

### v0.4.0

- Index Documents (Field-Search)

### v0.3.6

- Right-To-Left Support
- CJK Word Splitting Support

### v0.3.5

- Promise Support

### v0.3.4

- Export / Import Indexes (Serialize)

### v0.3.0

- Profiler Support


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
<!-- FlexSearch v0.8: [Overview and Migration Guide](doc/0.8.0.md) -->
Getting instant help by the DeepWiki AI assistant:

[<img src="https://devin.ai/assets/deepwiki-badge.png" alt="Ask DeepWiki.com" height="20"/>](https://deepwiki.com/nextapps-de/flexsearch)

<h2></h2>
<h1>
    <img src="doc/flexsearch-logo-glass-animated.svg" style="width: 580px; max-width: 100%" alt="FlexSearch.js: Next-Generation full-text search library for Browser and Node.js">
    <p></p>
</h1>
<h3>Next-Generation full-text search library for Browser and Node.js</h3>

<a target="_blank" href="https://www.npmjs.com/package/flexsearch"><img src="https://img.shields.io/npm/v/flexsearch.svg"></a>
<a target="_blank" href="https://github.com/nextapps-de/flexsearch/actions"><img src="https://img.shields.io/badge/build-passing-brightgreen"></a>
<img src="https://img.shields.io/badge/coverage-84%25-yellow">
<img src="https://img.shields.io/badge/typed-75%25-yellow"><!--<a target="_blank" href="https://github.com/nextapps-de/flexsearch/issues"><img src="https://img.shields.io/github/issues/nextapps-de/flexsearch.svg"></a>-->
<a target="_blank" href="https://github.com/nextapps-de/flexsearch/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/flexsearch.svg"></a>

[Basic Start](#load-library) &ensp;&bull;&ensp; 
[API Reference](#api-overview) &ensp;&bull;&ensp;
[Encoder](doc/encoder.md) &ensp;&bull;&ensp;
[Document Search](doc/document-search.md) &ensp;&bull;&ensp;
[Persistent Indexes](doc/persistent.md) &ensp;&bull;&ensp;
[Using Worker](doc/worker.md) &ensp;&bull;&ensp;
[Tag Search](doc/document-search.md#tag-search) &ensp;&bull;&ensp;
[Highlighting](doc/result-highlighting.md) &ensp;&bull;&ensp;
[Resolver](doc/resolver.md) &ensp;&bull;&ensp;
[Changelog](CHANGELOG.md)

## Please Support this Project

FlexSearch has been helping developers around the world build powerful, efficient search functionalities for years. Maintaining and improving the library requires significant time and resources. If you’ve found this project valuable and you're interested in supporting the project, please consider donating. Thanks a lot for your continued support!

<a href="https://opencollective.com/flexsearch/donate" target="_blank" style="margin-right: 10px"><img src="doc/opencollective.png" height="32" alt="Donate using Open Collective"></a>
<a href="https://github.com/sponsors/ts-thomas/" target="_blank" style="margin-right: 10px"><img src="doc/github-sponsors.png" height="32" alt="Donate using Github Sponsors"></a>
<a href="https://liberapay.com/ts-thomas/donate" target="_blank" style="margin-right: 10px"><img src="doc/liberapay.svg" height="32" alt="Donate using Liberapay"></a>
<a href="https://www.patreon.com/user?u=96245532" target="_blank" style="margin-right: 10px"><img src="doc/patron.png" height="32" alt="Donate using Patreon"></a>
<a href="https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW" target="_blank"><img src="doc/paypal.png" height="32" alt="Donate using PayPal"></a>

### FlexSearch Sponsors

<a href="https://antithesis.com" target="_blank" style="display: inline-block">
    <center>
        <img src="doc/antithesis_logo.svg" width="200" alt="Donate using Open Collective"><br>
        Antithesis Operations LLC
    </center>
</a>
<h1></h1>

FlexSearch performs queries up to 1,000,000 times faster <a href="https://nextapps-de.github.io/flexsearch/" target="_blank">compared to other libraries</a> by also providing <a href="https://nextapps-de.github.io/flexsearch/match.html" target="_blank">powerful search capabilities</a> like multi-field search (document search), phonetic transformations, partial matching, tag-search, result highlighting or suggestions.

Bigger workloads are scalable through workers to perform any updates or queries to the index in parallel through dedicated balanced threads.

The latest generation v0.8 introduce [Persistent Indexes](doc/persistent.md), well optimized for scaling of large datasets and running in parallel. All available features was natively ported right into the database engine of your choice.

FlexSearch was nominated by the GitNation for the "Best Technology of the Year".

Supported Platforms:
- Browser
- Node.js

Supported Database:
- InMemory (Default)
- [IndexedDB (Browser)](doc/persistent-indexeddb.md)
- [Redis](doc/persistent-redis.md)
- [SQLite](doc/persistent-sqlite.md)
- [Postgres](doc/persistent-postgres.md)
- [MongoDB](doc/persistent-mongodb.md)
- [Clickhouse](doc/persistent-clickhouse.md)

Supported Charsets:
- Latin
- Chinese, Korean, Japanese (CJK)
- Hindi
- Arabic
- Cyrillic
- Greek and Coptic
- Hebrew

Common Code Examples:

- Node.js: [Module (ESM)](example/nodejs-esm)
- Node.js: [CommonJS](example/nodejs-commonjs)
- Browser: [Module (ESM)](example/browser-module)
- Browser: [Legacy Script](example/browser-legacy)

Demos:
- <a href="https://raw.githack.com/nextapps-de/flexsearch/master/demo/autocomplete.html" target="_blank">Auto-Complete</a>

<a name="benchmark"></a>
Benchmarks:
- <a href="https://nextapps-de.github.io/flexsearch/" target="_blank">Performance Benchmark</a>
- <a href="https://nextapps-de.github.io/flexsearch/match.html" target="_blank">Matching Benchmark</a>

<details>
<summary>Latest Benchmark Results</summary>
<br>
The benchmark was measured in terms per seconds, higher values are better (except the test "Memory").
The memory value refers to the amount of memory which was additionally allocated during search.<br>

<table>
    <tr></tr>
    <tr>
        <th>Library</th>
        <th>Memory</th>
        <th>Query: Single</th>
        <th>Query: Multi</th>
        <th>Query: Large</th>
        <th>Query: Not Found</th>
    </tr>
    <tr>
        <td>flexsearch</td>
        <td align="right">16</td>
        <td align="right">50955718</td>
        <td align="right">11912730</td>
        <td align="right">13981110</td>
        <td align="right">51706499</td>
    </tr>
    <tr></tr>
    <tr>
        <td>jsii</td>
        <td align="right">2188</td>
        <td align="right">13847</td>
        <td align="right">949559</td>
        <td align="right">1635959</td>
        <td align="right">3730307</td>
    </tr>
    <tr></tr>
    <tr>
        <td>wade</td>
        <td align="right">980</td>
        <td align="right">60473</td>
        <td align="right">443214</td>
        <td align="right">419152</td>
        <td align="right">1239372</td>
    </tr>
    <tr></tr>
    <tr>
        <td>js-search</td>
        <td align="right">237</td>
        <td align="right">22982</td>
        <td align="right">383775</td>
        <td align="right">426609</td>
        <td align="right">994803</td>
    </tr>
    <tr></tr>
    <tr>
        <td>minisearch</td>
        <td align="right">4777</td>
        <td align="right">30589</td>
        <td align="right">191657</td>
        <td align="right">5849</td>
        <td align="right">304233</td>
    </tr>
    <tr></tr>
    <tr>
        <td>orama</td>
        <td align="right">5355</td>
        <td align="right">29445</td>
        <td align="right">170231</td>
        <td align="right">4454</td>
        <td align="right">225491</td>
    </tr>
    <tr></tr>
    <tr>
        <td>elasticlunr</td>
        <td align="right">3073</td>
        <td align="right">14326</td>
        <td align="right">48558</td>
        <td align="right">101206</td>
        <td align="right">95840</td>
    </tr>
    <tr></tr>
    <tr>
        <td>lunr</td>
        <td align="right">2443</td>
        <td align="right">11527</td>
        <td align="right">51476</td>
        <td align="right">88858</td>
        <td align="right">103386</td>
    </tr>
    <tr></tr>
    <tr>
        <td>ufuzzy</td>
        <td align="right">13754</td>
        <td align="right">2799</td>
        <td align="right">7788</td>
        <td align="right">58544</td>
        <td align="right">9557</td>
    </tr>
    <tr></tr>
    <tr>
        <td>bm25</td>
        <td align="right">33963</td>
        <td align="right">3903</td>
        <td align="right">4777</td>
        <td align="right">12657</td>
        <td align="right">12471</td>
    </tr>
    <tr></tr>
    <tr>
        <td>fuzzysearch</td>
        <td align="right">300147</td>
        <td align="right">148</td>
        <td align="right">229</td>
        <td align="right">455</td>
        <td align="right">276</td>
    </tr>
    <tr></tr>
    <tr>
        <td>fuse</td>
        <td align="right">247107</td>
        <td align="right">422</td>
        <td align="right">321</td>
        <td align="right">337</td>
        <td align="right">329</td>
    </tr>
</table>

Run Comparison: <a href="https://nextapps-de.github.io/flexsearch/" target="_blank">Performance Benchmark "Gulliver's Travels"</a>

</details>

Extern Projects & Plugins:
- React: https://github.com/angeloashmore/react-use-flexsearch
- Vue: https://github.com/Noction/vue-use-flexsearch
- Gatsby: https://www.gatsbyjs.org/packages/gatsby-plugin-flexsearch/
- Nikola: https://plugins.getnikola.com/v8/flexsearch_plugin/

## Table of contents

> [!TIP]
> Understanding those 3 elementary things about FlexSearch will improve your results significantly: [Tokenizer](#tokenizer-partial-match), [Encoder](doc/encoder.md) and [Suggestions](#suggestions)

- [Load Library (Node.js, ESM, Legacy Browser)](#load-library)
  - [Non-Module Bundles (ES5 Legacy)](#non-module-bundles-es5-legacy)
  - [Module (ESM)](#module-esm)
  - [Node.js](#nodejs)
- [Basic Usage and Variants](#basic-usage-and-variants)
  - [Index Options](#index-options)
  - [Search Options](#search-options)
- [Common Code Examples (Browser, Node.js)](#common-code-examples)
- [API Overview](#api-overview)
- [Presets](#presets)
- [Context Search](#context-search)
  - [Context Options](#context-options)
- [Fast-Update Mode](#fast-update-mode)
- [Suggestions](#suggestions)
- [Document Search (Multi-Field Search)](doc/document-search.md)
  - [Document Index Options](doc/document-search.md#document-options)
  - [Document Descriptor](doc/document-search.md#the-document-descriptor)
  - [Document Search Options](doc/document-search.md#document-search-options)
  - [Multi-Tag Search](doc/document-search.md)
  - [Result Highlighting](doc/result-highlighting.md)
    - [Highlighting Options](doc/result-highlighting.md#highlighting-options)
      - [Boundary Options](doc/result-highlighting.md#highlighting-boundary-options)
      - [Ellipsis Options](doc/result-highlighting.md#highlighting-ellipsis-options)
- [Phonetic Search (Fuzzy Search)](#fuzzy-search)
- [Tokenizer (Partial Search)](#tokenizer-partial-match)
- [Charset Collection](#charset-collection)
- [Encoder](doc/encoder.md)
  - [Encoder Options](doc/encoder.md#encoder-options)
  - [Universal Charset Collection](doc/encoder.md)
  - [Latin Charset Encoder Presets](doc/encoder.md)
  - [Language Specific Preset](doc/encoder.md)
  - [Custom Encoder](doc/encoder.md#custom-encoder)
- [Async Non-Blocking Runtime Balancer](doc/async.md)
- [Worker Indexes](doc/worker.md)
  - [Worker Index Options](doc/worker.md#worker-index-options)
- [Resolver (Complex Queries)](doc/resolver.md)
  - [Resolver Options](doc/resolver.md)
  - [Boolean Operations (and, or, xor, not)](doc/resolver.md)
  - [Boost](doc/resolver.md)
  - [Limit / Offset](doc/resolver.md)
  - [Resolve](doc/resolver.md)
- [Auto-Balanced Cache by Popularity/Last Query](#auto-balanced-cache-by-popularity)
- [Export / Import Indexes](doc/export-import.md)
  - [Fast-Boot Serialization](doc/export-import.md#fast-boot-serialization-for-server-side-rendering-php-python-ruby-rust-java-go-nodejs-)
- [Persistent Indexes](doc/persistent.md)
  - [Persistent Index Options](doc/persistent.md)
  - [IndexedDB (Browser)](doc/persistent-indexeddb.md)
  - [Postgres](doc/persistent-postgres.md)
  - [Redis](doc/persistent-redis.md)
  - [MongoDB](doc/persistent-mongodb.md)
  - [SQLite](doc/persistent-sqlite.md)
  - [Clickhouse](doc/persistent-clickhouse.md)
- [Custom Score Function](doc/customization.md)
- [Custom Builds](doc/custom-builds.md)
- [Extended Keystores (In-Memory Index)](doc/keystore.md)
- [Best Practices](#best-practices)
  - [Page-Load / Fast-Boot](#page-load--fast-boot)
  - [Prefer numeric typed IDs](#use-numeric-ids)

## Load Library (Node.js, ESM, Legacy Browser)

```bash
npm install flexsearch
```

The **_dist_** folder is located in: `node_modules/flexsearch/dist/`

> It is not recommended to use the `/src/` folder of this repository as it requires some kind of conditional compilation to resolve the build flags. The `/dist/` folder contains every version you might need including unminified ES6 modules. When none of the `/dist/` folder versions works for you please open an issue. Alternatively you can read more about [Custom Builds](doc/custom-builds.md).

<details>
<summary>Download Builds</summary>
<br>
<table>
    <tr></tr>
    <tr>
        <td>Build</td>
        <td>File</td>
        <td>CDN</td>
    </tr>
    <tr>
        <td>flexsearch.bundle.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.bundle.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.bundle.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.bundle.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.bundle.module.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.bundle.module.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.module.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.module.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.bundle.module.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.bundle.module.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.module.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.bundle.module.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.compact.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.compact.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.compact.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.compact.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.compact.module.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.compact.module.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.module.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.module.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.compact.module.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.compact.module.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.module.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.compact.module.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.light.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.light.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.min.js</a></td>
    </tr>****
    <tr></tr>
    <tr>
        <td>flexsearch.light.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.light.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.light.module.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.light.module.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.module.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.module.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.light.module.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.light.module.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.module.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.light.module.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.es5.min.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.es5.min.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.es5.min.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.es5.min.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.es5.debug.js</td>
        <td><a href="https://github.com/nextapps-de/flexsearch/raw/0.8.2/dist/flexsearch.es5.debug.js" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.es5.debug.js" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/flexsearch.es5.debug.js</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>Javascript Modules (ESM)</td>
        <td><a href="https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fnextapps-de%2Fflexsearch%2Ftree%2F0.8.2%2Fdist%2Fmodule" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module/" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module/</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>Javascript Modules Minified (ESM)</td>
        <td><a href="https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fnextapps-de%2Fflexsearch%2Ftree%2F0.8.2%2Fdist%2Fmodule-min" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module-min/" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module-min/</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>Javascript Modules Debug (ESM)</td>
        <td><a href="https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fnextapps-de%2Fflexsearch%2Ftree%2F0.8.2%2Fdist%2Fmodule-debug" target="_blank">Download</a></td>
        <td><a href="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module-debug/" target="_blank">https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.8.2/dist/module-debug/</a></td>
    </tr>
    <tr></tr>
    <tr>
        <td>flexsearch.custom.js</td>
        <td colspan="2"><a href="/doc/custom-builds.md">Read more about "Custom Build"</a></td>
    </tr>
</table>

</details>
<a name="bundles"></a>
<details>
<summary>Compare Bundles: Light, Compact, Bundle</summary>
<br>

> The Node.js package includes all features.

<table>
    <tr></tr>
    <tr>
        <td>Feature</td>
        <td>flexsearch.bundle.js</td>
        <td>flexsearch.compact.js</td>
        <td>flexsearch.light.js</td>
    </tr>
    <tr>
        <td>
            <a href="#presets">Presets</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/async.md">Async Processing</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/worker.md">Workers (Web + Node.js)</a>
        </td>
        <td>✓</td>
        <td>-</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="#context-search">Context Search</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/document-search.md">Document Search</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/document-search.md#store">Document Datastore</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="#tokenizer">Partial Matching</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/cache.md">Auto-Balanced Cache by Popularity/Last Queries</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="doc/document-search.md#tag-search">Tag Search</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="#suggestions">Suggestions</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr></tr>
    <tr>
        <td>
            <a href="#fuzzy-search">Phonetic Search (Fuzzy Search)</a>
        </td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td><a href="doc/encoder.md">Encoder</a></td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr></tr>
    <tr>
        <td><a href="doc/export-import.md">Export / Import Indexes</a></td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td><a href="doc/resolver.md">Resolver</a></td>
        <td>✓</td>
        <td>-</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td><a href="doc/result-highlighting.md">Result Highlighting</a></td>
        <td>✓</td>
        <td>✓</td>
        <td>-</td>
    </tr>
    <tr></tr>
    <tr>
        <td><a href="doc/persistent.md">Persistent Index (IndexedDB)</a></td>
        <td>✓</td>
        <td>-</td>
        <td>-</td>
    </tr>
    <tr>
        <td>File Size (gzip)</td>
        <td>16.3 kb</td>
        <td>11.4 kb</td>
        <td>4.5 kb</td>
    </tr>
</table>

</details>

> [!TIP]
> All debug versions are providing debug information through the console and gives you helpful advices on certain situations. Do not use them in production, since they are special builds containing extra debugging processes which noticeably reduce performance.

The abbreviations used at the end of the filenames indicates:

- `bundle` All features included, FlexSearch is available on `window.FlexSearch`
- `light` Only basic features are included, FlexSearch is available on `window.FlexSearch`
- `es5` bundle has support for EcmaScript5, FlexSearch is available on `window.FlexSearch`
- `module` indicates that this bundle is a Javascript module (ESM), FlexSearch members are available by `import { Index, Document, Worker, Encoder, Charset } from "./flexsearch.bundle.module.min.js"` or alternatively using the default export `import FlexSearch from "./flexsearch.bundle.module.min.js"`
- `min` bundle is minified
- `debug` bundle has enabled debug mode and contains additional code just for debugging purposes (do not use for production)

## Load Library

### Non-Module Bundles (ES5 Legacy)

> Non-Module Bundles export all their features to the public namespace "FlexSearch" e.g. `window.FlexSearch.Index` or `window.FlexSearch.Document`.

Load the bundle by a script tag:

```html
<script src="dist/flexsearch.bundle.min.js"></script>
<script>
  // ... access FlexSearch
  var Index = window.FlexSearch.Index;
  var index = new Index(/* ... */);
</script>
```

FlexSearch Members are accessible on:
```js
var Index = window.FlexSearch.Index;
var Document = window.FlexSearch.Document;
var Encoder = window.FlexSearch.Encoder;
var Charset = window.FlexSearch.Charset;
var Resolver = window.FlexSearch.Resolver;
var Worker = window.FlexSearch.Worker;
var IdxDB = window.FlexSearch.IndexedDB;
// only exported by non-module builds:
var Language = window.FlexSearch.Language;
```

Load language packs:

```html
<!-- English: -->
<script src="dist/lang/en.min.js"></script>
<!-- German: -->
<script src="dist/lang/de.min.js"></script>
<!-- French: -->
<script src="dist/lang/fr.min.js"></script>
<script>
  var EnglishEncoderPreset = window.FlexSearch.Language.en;
  var GermanEncoderPreset = window.FlexSearch.Language.de;
  var FrenchEncoderPreset = window.FlexSearch.Language.fr;
</script>
```

### Module (ESM)

When using modules you can choose from 2 variants: `flexsearch.xxx.module.min.js` has all features bundled ready for production, whereas the folder `/dist/module/` export all the features in the same structure as the source code but here compiler flags was resolved.

Also, for each variant there exist:
1. A debug version for the development
2. A pre-compiled minified version for production

Use the bundled version exported as a module (default export):

```html
<script type="module">
    import FlexSearch from "./dist/flexsearch.bundle.module.min.js";
    const index = new FlexSearch.Index(/* ... */);
</script>
```

Or import FlexSearch members separately by:

```html
<script type="module">
    import { Index, Document, Encoder, Charset, Resolver, Worker, IndexedDB } 
        from "./dist/flexsearch.bundle.module.min.js";
    const index = new Index(/* ... */);
</script>
```

Use bundled style on non-bundled modules:

```html
<script type="module">
    import { Index, Document, Encoder, Charset, Resolver, Worker, IndexedDB }
        from "./dist/module/bundle.js";
    const index = new Index(/* ... */);
</script>
```

Use non-bundled modules by file default exports:

```html
<script type="module">
    import Index from "./dist/module/index.js";
    import Document from "./dist/module/document.js";
    import Encoder from "./dist/module/encoder.js";
    import Charset from "./dist/module/charset.js";
    import Resolver from "./dist/module/resolver.js";
    import Worker from "./dist/module/worker.js";
    import IndexedDB from "./dist/module/db/indexeddb/db.js";
    const index = new Index(/* ... */);
</script>
```

Language packs are accessible via:

```js
import EnglishEncoderPreset from "./dist/module/lang/en.js";
import GermanEncoderPreset from "./dist/module/lang/de.js";
import FrenchEncoderPreset from "./dist/module/lang/fr.js";
```

Also, pre-compiled non-bundled production-ready modules are located in `dist/module-min/`, whereas the debug version is located at `dist/module-debug/`.

You can also load modules via CDN:

```html
<script type="module">
    import Index from "https://unpkg.com/flexsearch@0.8.2/dist/module/index.js";
    const index = new Index(/* ... */);
</script>
```

### Node.js

Install FlexSearch via NPM:

```npm
npm install flexsearch
```

Use the default export:

```js
const FlexSearch = require("flexsearch");
const index = new FlexSearch.Index(/* ... */);
```

Or require FlexSearch members separately by:

```js
const { Index, Document, Encoder, Charset, Resolver, Worker } = require("flexsearch");
const index = new Index(/* ... */);
```

When using ESM instead of CommonJS:

```js
import { Index, Document, Encoder, Charset, Resolver, Worker } from "flexsearch";
const index = new Index(/* ... */);
```

Language packs are accessible via:

```js
const EnglishEncoderPreset = require("flexsearch/lang/en");
const GermanEncoderPreset = require("flexsearch/lang/de");
const FrenchEncoderPreset = require("flexsearch/lang/fr");
```

Persistent Connectors are accessible via:

```js
const Postgres = require("flexsearch/db/postgres");
const Sqlite = require("flexsearch/db/sqlite");
const MongoDB = require("flexsearch/db/mongodb");
const Redis = require("flexsearch/db/redis");
const Clickhouse = require("flexsearch/db/clickhouse");
```

## Basic Usage and Variants

There are 3 types of indexes:

1. `Index` is a flat high performance index which stores id-content-pairs.
2. `Worker` / `WorkerIndex` is also a flat index which stores id-content-pairs but runs in background as a dedicated worker thread.
3. `Document` is multi-field index which can store complex JSON documents (could also exist of worker indexes).

The most of you probably need just one of them according to your scenario. Any of these 3 index type are upgradable to persistent indexes.

The `worker` instance inherits from type `Index` and basically works like a standard FlexSearch Index. A document index is a complex register automatically operating on several of those standard indexes in parallel. Worker-Support in documents needs to be enabled by just passing the appropriate option during creation e.g. `{ worker: true }`.

```js
index.add(id, text);
const result = index.search(text, options);
```

```js
document.add(doc);
const result = document.search(text, options);
```

```js
await worker.add(id, text);
const result = await worker.search(text, options);
```

> Every method called on a `Worker` index is treated as async. You will get back a `Promise` or you can provide a callback function as the last parameter alternatively.

### Common Code Examples

The documentation will refer to several examples. A list of all examples:

<a name="examples-nodejs"></a>
<details>
<summary>Examples Node.js (CommonJS)</summary><br>

- [basic](example/nodejs-commonjs/basic)
- [basic-suggestion](example/nodejs-commonjs/basic-suggestion)
- [basic-persistent](example/nodejs-commonjs/basic-persistent)
- [basic-resolver](example/nodejs-commonjs/basic-resolver)
- [basic-worker](example/nodejs-commonjs/basic-worker)
- [basic-worker-extern-config](example/nodejs-commonjs/basic-worker-extern-config)
- [basic-worker-export-import](example/nodejs-commonjs/basic-worker-export-import)
- [basic-export-import](example/nodejs-commonjs/basic-export-import)
- [document](example/nodejs-commonjs/document)
- [document-persistent](example/nodejs-commonjs/document-persistent)
- [document-resolver](example/nodejs-commonjs/document-resolver)
- [document-worker](example/nodejs-commonjs/document-worker)
- [document-worker-extern-config](example/nodejs-commonjs/document-worker-extern-config)
- [document-export-import](example/nodejs-commonjs/document-export-import)
- [document-worker-export-import](example/nodejs-commonjs/document-worker-export-import)
- [language-pack](example/nodejs-commonjs/language-pack)

</details>
<details>
<summary>Examples Node.js (ESM/Module)</summary><br>

- [basic](example/nodejs-esm/basic)
- [basic-suggestion](example/nodejs-esm/basic-suggestion)
- [basic-persistent](example/nodejs-esm/basic-persistent)
- [basic-resolver](example/nodejs-esm/basic-resolver)
- [basic-worker](example/nodejs-esm/basic-worker)
- [basic-worker-extern-config](example/nodejs-esm/basic-worker-extern-config)
- [basic-worker-export-import](example/nodejs-esm/basic-worker-export-import)
- [basic-export-import](example/nodejs-esm/basic-export-import)
- [document](example/nodejs-esm/document)
- [document-persistent](example/nodejs-esm/document-persistent)
- [document-resolver](example/nodejs-esm/document-resolver)
- [document-worker](example/nodejs-esm/document-worker)
- [document-worker-extern-config](example/nodejs-esm/document-worker-extern-config)
- [document-export-import](example/nodejs-esm/document-export-import)
- [document-worker-export-import](example/nodejs-esm/document-worker-export-import)
- [language-pack](example/nodejs-esm/language-pack)s

</details>

<a name="examples-browser"></a>
<details>
<summary>Examples Browser (Legacy)</summary><br>

- [basic](example/browser-legacy/basic)
- [basic-suggestion](example/browser-legacy/basic-suggestion)
- [basic-persistent](example/browser-legacy/basic-persistent)
- [basic-resolver](example/browser-legacy/basic-resolver)
- [basic-worker](example/browser-legacy/basic-worker)
- [document](example/browser-legacy/document)
- [document-highlighting](example/browser-legacy/document-highlighting)
- [document-persistent](example/browser-legacy/document-persistent)
- [document-resolver](example/browser-legacy/document-resolver)
- [document-worker](example/browser-legacy/document-worker)
- [language-pack](example/browser-legacy/language-pack)

</details>
<details>
<summary>Examples Browser (ESM/Module)</summary><br>

- [basic](example/browser-module/basic)
- [basic-suggestion](example/browser-module/basic-suggestion)
- [basic-persistent](example/browser-module/basic-persistent)
- [basic-resolver](example/browser-module/basic-resolver)
- [basic-worker](example/browser-module/basic-worker)
- [basic-worker-extern-config](example/browser-module/basic-worker-extern-config)
- [document](example/browser-module/document)
- [document-highlighting](example/browser-module/document-highlighting)
- [document-persistent](example/browser-module/document-persistent)
- [document-resolver](example/browser-module/document-resolver)
- [document-worker](example/browser-module/document-worker)
- [document-worker-extern-config](example/browser-module/document-worker-extern-config)
- [language-pack](example/browser-module/language-pack)
  
</details>

## API Overview

Constructors:

- new [**Index**](#basic-usage)(\<options\>) : <small>_index_</small>
- new [**Document**](doc/document-search.md)(options) : <small>_document_</small>
- new [**Worker**](doc/worker.md)(\<options\>) : <small>_worker_</small>
- new [**Encoder**](doc/encoder.md)(\<options\>, \<options\>, ...) : <small>_encoder_</small>
- new [**Resolver**](doc/resolver.md)(\<options\>) : <small>_resolver_</small>
- new [**IndexedDB**](doc/persistent-indexeddb.md)(\<options\>) : <small>_indexeddb_</small>

---

Global Members:

- [**Charset**](#charset-collection)
- [**Language**](doc/encoder.md#built-in-language-packs) (Legacy Browser Only)

---

`Index` / `Worker`-Index Methods:

- index.[**add**](#add-text-item-to-an-index)(id, string)
- index.[**append**]()(id, string)
- index.[**update**](#update-item-from-an-index)(id, string)
- index.[**remove**](#remove-item-from-an-index)(id)
- index.[**search**](#search-items)(string, \<limit\>, \<options\>)
- index.[**search**](#search-items)(options)
- index.[**searchCache**](#auto-balanced-cache-by-popularity)(...)
- index.[**contain**](#check-existence-of-already-indexed-ids)(id)
- index.[**clear**](#clear-all-items-from-an-index)()
- index.[**cleanup**](#fast-update-mode)()

##

- <small>_async_</small> index.[**export**](doc/export-import.md)(handler)
- <small>_async_</small> index.[**import**](doc/export-import.md)(key, data)
- <small>_async_</small> index.[**serialize**](doc/export-import.md#fast-boot-serialization-for-server-side-rendering-php-python-ruby-rust-java-go-nodejs-)(boolean)

##

- <small>_async_</small> index.[**mount**](doc/persistent.md)(db)
- <small>_async_</small> index.[**commit**](doc/persistent.md)()
- <small>_async_</small> index.[**destroy**](doc/persistent.md#delete-store--migration)()

---

`Document` Methods:

- document.[**add**](doc/document-search.md#addupdateremove-documents)(\<id\>, document)
- document.[**append**]()(\<id\>, document)
- document.[**update**](doc/document-search.md#addupdateremove-documents)(\<id\>, document)
- document.[**remove**](doc/document-search.md#addupdateremove-documents)(id)
- document.[**remove**](doc/document-search.md#addupdateremove-documents)(document)
- document.[**search**](doc/document-search.md#document-search-field-search)(string, \<limit\>, \<options\>)
- document.[**search**](doc/document-search.md#document-search-field-search)(options)
- document.[**searchCache**](#auto-balanced-cache-by-popularity)(...)
- document.[**contain**](doc/document-search.md)(id)
- document.[**clear**](doc/document-search.md)()
- document.[**cleanup**](#fast-update-mode)()
- document.[**get**](doc/document-search.md#document-store)(id)
- document.[**set**](doc/document-search.md#document-store)(\<id\>, document)

##

- <small>_async_</small> document.[**export**](doc/export-import.md)(handler)
- <small>_async_</small> document.[**import**](doc/export-import.md)(key, data)

##

- <small>_async_</small> document.[**mount**](doc/persistent.md)(db)
- <small>_async_</small> document.[**commit**](doc/persistent.md)()
- <small>_async_</small> document.[**destroy**](doc/persistent.md#delete-store--migration)()

`Document` Properties:

- document.[**store**](doc/document-search.md#document-store)

---

Async Equivalents (Non-Blocking Balanced):

- <small>_async_</small> [**.addAsync**](doc/async.md)( ... , \<callback\>)
- <small>_async_</small> [**.appendAsync**](doc/async.md)( ... , \<callback\>)
- <small>_async_</small> [**.updateAsync**](doc/async.md)( ... , \<callback\>)
- <small>_async_</small> [**.removeAsync**](doc/async.md)( ... , \<callback\>)
- <small>_async_</small> [**.searchAsync**](doc/async.md)( ... , \<callback\>)
- <small>_async_</small> [**.searchCacheAsync**](doc/async.md)( ... , \<callback\>)

Async methods will return a `Promise`, additionally you can pass a callback function as the last parameter.

Methods `.export()` and also `.import()` are always async as well as every method you call on a `Worker`-based or `Persistent` Index.

---

`Encoder` Methods:

- encoder.[**encode**](doc/encoder.md)(string)
- encoder.[**assign**](doc/encoder.md)(options, \<options\>, ...)
- encoder.[**addFilter**](doc/encoder.md#add-language-specific-stemmer-andor-filter)(string)
- encoder.[**addStemmer**](doc/encoder.md#add-language-specific-stemmer-andor-filter)(string => boolean)
- encoder.[**addMapper**](doc/encoder.md)(char, char)
- encoder.[**addMatcher**](doc/encoder.md)(string, string)
- encoder.[**addReplacer**](doc/encoder.md)(regex, string)

---

`Resolver` Methods:

- resolver.[**and**](doc/resolver.md)(options)
- resolver.[**or**](doc/resolver.md)(options)
- resolver.[**xor**](doc/resolver.md)(options)
- resolver.[**not**](doc/resolver.md)(options)
- resolver.[**boost**](doc/resolver.md)(number)
- resolver.[**limit**](doc/resolver.md)(number)
- resolver.[**offset**](doc/resolver.md)(number)
- resolver.[**resolve**](doc/resolver.md)(\<options\>)

`Resolver` Properties:

- resolver.[**result**](doc/resolver.md)
- resolver.[**await**](doc/resolver.md) (Async)

---

`StorageInterface` Methods:

- <small>_async_</small> db.[**mount**](doc/persistent.md)(index, \<options\>)
- <small>_async_</small> db.[**open**](doc/persistent.md)()
- <small>_async_</small> db.[**close**](doc/persistent.md)()
- <small>_async_</small> db.[**destroy**](doc/persistent.md)()
- <small>_async_</small> db.[**clear**](doc/persistent.md)()
- <small>_async_</small> db.[**commit**](doc/persistent.md)(index)

---

`Charset` Universal Encoder Preset:

- Charset.[**Exact**](#charset-collection)
- Charset.[**Default**](#charset-collection)
- Charset.[**Normalize**](#charset-collection)

`Charset` Latin-specific Encoder Preset:

- Charset.[**LatinBalance**](#charset-collection)
- Charset.[**LatinAdvanced**](#charset-collection)
- Charset.[**LatinExtra**](#charset-collection)
- Charset.[**LatinSoundex**](#charset-collection)

`Charset` Chinese, Japanese, Korean Encoder Preset:

- Charset.[**CJK**](#charset-collection)

---

`Language` Encoder Preset:
- [**en**](doc/encoder.md#built-in-language-packs)
- [**de**](doc/encoder.md#built-in-language-packs)
- [**fr**](doc/encoder.md#built-in-language-packs)

## Basic Usage

#### Create a new index

```js
const index = new Index();
```

Create a new index and choosing one of the [Presets](#presets):

```js
const index = new Index("match");
```

Create a new index with custom options:

```js
const index = new Index({
    tokenize: "forward"
});
```

Create a new index and extend a preset with custom options:

```js
var index = new FlexSearch({
    preset: "memory",
    tokenize: "forward",
    resolution: 5
});
```

Create a new index and assign an [Encoder](doc/encoder.md):

```js
import { Charset } from "flexsearch";
const index = new Index({
    tokenize: "forward",
    encoder: Charset.LatinBalance
});
```

Related Topics: [Index Options](#index-options) 
&ensp;&bull;&ensp; [Resolution](#resolution)
&ensp;&bull;&ensp; [Charset Collection](#charset-collection)
&ensp;&bull;&ensp; [Tokenizer](#tokenizer-partial-match)

#### Add text item to an index

Every content which should be added to the index needs an ID. When your content has no ID, then you need to create one by passing an index or count or something else as an ID (a value from type `number` is highly recommended). Those IDs are unique references to a given content. This is important when you update or adding over content through existing IDs. When referencing is not a concern, you can simply use something simple like `count++`.

> Index.__add(id, string)__

```js
index.add(0, "John Doe");
```

#### Search items

> Index.__search(string | options, \<limit\>, \<options\>)__

```js
index.search("John");
```

Limit the result:

```js
index.search("John", 10);
```

#### Check existence of already indexed IDs

You can check if an ID was already indexed by:

```js
if(index.contain(1)){
    console.log("ID was found in index");
}
```

#### Update item from an index

> Index.__update(id, string)__

```js
index.update(0, "Max Miller");
```

#### Remove item from an index

> Index.__remove(id)__

```js
index.remove(0);
```

#### Clear all items from an index

> Index.__clear()__

```js
index.clear();
```

### Chaining

Simply chain methods like:

```js
const index = new Index().addMatcher({'â': 'a'}).add(0, 'foo').add(1, 'bar');
```

```js
index.remove(0).update(1, 'foo').add(2, 'foobar');
```

## Index Options

<table>
    <tr></tr>
    <tr>
        <td>Option</td>
        <td>Values</td>
        <td>Description</td>
        <td>Default</td>
    </tr>
    <tr>
        <td>preset</td>
        <td>
            "memory"<br>
            "performance"<br>
            "match"<br>
            "score"<br>
            "default"
        </td>
        <td>
            The <a href="#presets">configuration profile</a> as a shortcut or as a base for your custom settings.<br>
        </td>
        <td>"default"</td>
    </tr>
    <tr></tr>
    <tr>
        <td>tokenize</td>
        <td>
            "strict" / "exact"<br>
            "tolerant"<br>
            "forward"<br>
            "reverse" / "bidirectional<br>
            "full"
        </td>
        <td>
            Indicates how terms should be indexed by <a href="#tokenizer-partial-match">tokenization</a>.
        </td>
        <td>"strict"</td>
    </tr>
    <tr></tr>
    <tr>
        <td>resolution</td>
        <td>
            Number
        </td>
        <td>Sets the scoring <a href="#resolution">resolution</a></td>
        <td>9</td>
    </tr>
    <tr></tr>
    <tr>
        <td>encoder</td>
        <td>
            <a href="doc/encoder.md">new Encoder(options)</a><br>
            Charset.Exact<br>
            Charset.Default<br>
            Charset.Normalize<br>
            Charset.LatinBalance<br>
            Charset.LatinAdvanced<br>
            Charset.LatinExtra<br>
            Charset.LatinSoundex<br>
            Charset.CJK<br>
            false
        </td>
        <td>Choose one of the <a href="#charset-collection">built-in encoder</a><br>Read more about <a href="doc/encoder.md">Encoder</a></td>
        <td>"default"</td>
    </tr>
    <tr></tr>
    <tr>
        <td>encode</td>
        <td>
            function(string) => string[]
        </td>
        <td>Pass a <a href="doc/encoder.md#custom-encoder">custom encoding function</a><br>Read more about <a href="doc/encoder.md">Encoder</a></td>
        <td>"default"</td>
    </tr>
    <tr></tr>
    <tr>
        <td>context</td>
        <td>
            Boolean<br>
            <a href="#context-options">Context Options</a>
        </td>
        <td>Enable/Disable <a href="#context-search">context index</a>. When passing "true" as a value will use the defaults for the context.</td>
        <td>false</td>
    </tr>
    <tr></tr>
    <tr>
        <td>cache</td>
        <td>
            Boolean<br>
            Number
        </td>
        <td>Enable/Disable and/or set capacity of cached entries.<br><br>The cache automatically balance stored entries related to their popularity.</td>
        <td>false</td>
    </tr>
    <tr></tr>
    <tr>
        <td>fastupdate</td>
        <td>
            Boolean
        </td>
        <td>Additionally add a <a href="#fastupdate">fastupdate index</a> which boost any replace/update/remove task to a high performance level by also increasing index size by ~30%.</td>
        <td>false</td>
    </tr>
    <tr></tr>
    <tr>
        <td>priority</td>
        <td>
            Number
        </td>
        <td>Sets the task execution priority (1 low priority - 9 high priority) when using the <a href="doc/async.md">async methods</a></td>
        <td>4</td>
    </tr>
    <tr></tr>
    <tr>
        <td>score</td>
        <td>
            function(string) => number
        </td>
        <td>Use a <a href="doc/customization.md">custom score function</a></td>
        <td></td>
    </tr>
    <tr></tr>
    <tr>
        <td>keystore</td>
        <td>
            Number
        </td>
        <td>Increase available size for In-Memory-Index by additionally using uniform balanced registers (<a href="doc/keystore.md">Keystore</a>). You can apply values from 1 to 64.</td>
        <td>false</td>
    </tr>
    <tr>
        <td colspan="4">
            Persistent Options:
        </td>
    </tr>
    <tr>
        <td>db</td>
        <td>
            StorageInterface
        </td>
        <td>Pass an instance of a <a href="doc/persistent.md">persistent adapter</a></td>
        <td></td>
    </tr>
    <tr></tr>
    <tr>
        <td>commit</td>
        <td>
            Boolean
        </td>
        <td>When disabled any changes won't commit, instead it needs calling <code>index.commit()</code> manually to make modifications to the index (add, update, remove) persistent.</td>
        <td>true</td>
    </tr>
</table>

## Search Options

<table>
    <tr></tr>
    <tr>
        <td>Option</td>
        <td>Values</td>
        <td>Description</td>
        <td>Default</td>
    </tr>
    <tr>
        <td>limit</td>
        <td>number</td>
        <td>Sets the limit of results</td>
        <td>100</td>
    </tr>
    <tr></tr>
    <tr>
        <td>offset</td>
        <td>number</td>
        <td>Apply offset (skip items)</td>
        <td>0</td>
    </tr>
    <tr></tr>
    <tr>
        <td>resolution</td>
        <td>number</td>
        <td>Limit the resolution (score) of the results</td>
        <td></td>
    </tr>
    <tr></tr>
    <tr>
        <td>suggest</td>
        <td>Boolean</td>
        <td>Enables <a href="#suggestions">Suggestions</a> in results</td>
        <td>false</td>
    </tr>
    <tr></tr>
    <tr>
        <td>cache</td>
        <td>Boolean</td>
        <td>Use a <a href="#auto-balanced-cache-by-popularity">Query Cache</a></td>
        <td>false</td>
    </tr>
    <tr></tr>
    <tr>
        <td>resolve</td>
        <td>Boolean</td>
        <td>When set to <code>false</code>, an instance of a <a href="doc/resolver.md">Resolver</a> is returned to apply further operations</td>
        <td>true</td>
    </tr>
</table>

## Suggestions

Any query on each of the index types is supporting the option `suggest: true`. Also within some of the `Resolver` stages (and, not, xor) you can add this option for the same purpose.

When suggestions is enabled, it allows results which does not perfectly match to the given query e.g. when one term was not included. Suggestion-Search will keep track of the scoring, therefore the first result entry is the closest one to a perfect match.

```js
const index = new Index().add(1, "cat dog bird");
const result = index.search("cat fish");
// result => []
```

Same query with suggestion enabled:

```js
const result = index.search("cat fish", { suggest: true });
// result => [ 1 ]
```

At least one match (or partial match) has to be found to get back any result:

```js
const result = index.search("horse fish", { suggest: true });
// result => []
```

## Resolution

The resolution refers to the maximum count of scoring slots on which the content is divided into.

> A formula to determine a well-balanced value for the `resolution` is: $2*floor(\sqrt{content.length})$ where content is the largest value pushed by `index.add()`. This formula does not apply to the `context` resolution.

A resolution of 1 will disable scoring, when `context` was not enabled.
A suggested minimum meaningful resolution is 3, because the first and last slot are reserved when available.

### Context Resolution

When `context` was enabled the minimum valuable resolution is 1.
You can adjust the resolution of the context index independently.
Giving both a value of 1 will disable scoring by term position related to the document root.
Instead, the scoring refers to the distance between each term within the query.

Although using a resolution > 1 can further improve context scoring. The default resolution still matters when context chain breaks and falls back to default index internally. A context resolution higher than 50% of the default resolution is probably too much.

## Tokenizer (Partial Match)

The tokenizer is one of the most important options and heavily influence:

1. required memory / storage
2. capabilities of partial matches

> [!TIP]
> If you want getting back results of an indexed term "flexsearch" when just typing "flex" or "search" then this is done by choosing a tokenizer.

Try to choose the most upper of these tokenizer which covers your requirements:

<table>
    <tr></tr>
    <tr>
        <td>Option</td>
        <td>Description</td>
        <td>Example</td>
        <td>Memory Factor (n = length of term)</td>
    </tr>
    <tr>
        <td><code>"strict"</code><br><code>"exact"</code><br><code>"default"</code></td>
        <td>index the full term</td>
        <td><code>foobar</code></td>
        <td>1</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>"forward"</code></td>
        <td>index term in forward direction (supports right-to-left by Index option <code>rtl: true</code>)</td>
        <td><code>fo</code>obar<br><code>foob</code>ar<br></td>
        <td>n</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>"reverse"</code><br><code>"bidirectional"</code></td>
        <td>index term in both directions</td>
        <td><code>fo</code>obar<br><code>foob</code>ar<br>foob<code>ar</code><br>fo<code>obar</code></td>
        <td>2n - 1</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>"tolerant"</code></td>
        <td>index the full term by also being tolerant against typos like swapped letters and missing letters</td>
        <td><code>foobra</code><br><code>foboar</code><br><code>foobr</code><br><code>fooba</code></td>
        <td>2(n - 2) + 2</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>"full"</code></td>
        <td>index every consecutive partial</td>
        <td>fo<code>oba</code>r<br>f<code>oob</code>ar</td>
        <td>n * (n - 1)</td>
    </tr>
</table>

## Charset Collection

Encoding is one of the most important task and heavily influence:

1. required memory / storage
2. capabilities of phonetic matches (Fuzzy-Search)

<table>
    <tr></tr>
    <tr>
        <td>Option</td>
        <td>Description</td>
        <td>Charset Type</td>
        <td>Compression Ratio</td>
    </tr>
    <tr>
        <td><code>Exact</code></td>
        <td>Bypass encoding and take exact input</td>
        <td>Universal (multi-lang)</td>
        <td>0%</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>Normalize</code><br><code>Default</code></td>
        <td>Case in-sensitive encoding<br>Charset normalization<br>Letter deduplication</td>
        <td>Universal (multi-lang)</td>
        <td>~ 7%</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>LatinBalance</code></td>
        <td>Case in-sensitive encoding<br>Charset normalization<br>Letter deduplication<br>Phonetic basic transformation</td>
        <td>Latin</td>
        <td>~ 30%</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>LatinAdvanced</code></td>
        <td>Case in-sensitive encoding<br>Charset normalization<br>Letter deduplication<br>Phonetic advanced transformation</td>
        <td>Latin</td>
        <td>~ 45%</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>LatinExtra</code></td>
        <td>Case in-sensitive encoding<br>Charset normalization<br>Letter deduplication<br>Soundex-like transformation</td>
        <td>Latin</td>
        <td>~ 60%</td>
    </tr>
    <tr></tr>
    <tr>
        <td><code>LatinSoundex</code></td>
        <td>Full Soundex transformation</td>
        <td>Latin</td>
        <td>~ 70%</td>
    </tr>
    <tr>
        <td><code>function(str) => [str]</code></td>
        <td>Pass a custom encoding function to the <code>Encoder</code></td>
        <td></td>
        <td></td>
    </tr>
</table>

## Fuzzy-Search

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

1. Use a tokenizer: `tolerant`, `forward`, `reverse` or `full`
2. Consider using any of the builtin encoder `normalize` > `balance` > `advanced` > `extra` > `soundex` (sorted by fuzziness)
3. Use one of the language-specific presets e.g. `/lang/en.js` for en-US specific content
4. Enable suggestions by passing the search option `suggest: true`

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.

### Compare Built-In Encoder Preset

Original term which was indexed: "Struldbrugs"

<table>
    <tr>
        <th align="left">Encoder:</th>
        <th><code>Exact</code></th>
        <th><code>Normalize (Default)</code></th>
        <th><code>LatinBalance</code></th>
        <th><code>LatinAdvanced</code></th>
        <th><code>LatinExtra</code></th>
        <th><code>LatinSoundex</code></th>
    </tr>
    <tr>
        <th align="left">Index Size</th>
        <th>3.1 Mb</th>
        <th>1.9 Mb</th>
        <th>1.7 Mb</th>
        <th>1.6 Mb</th>
        <th>1.1 Mb</th>
        <th>0.7 Mb</th>
    </tr>
    <tr>
        <td align="left">Struldbrugs</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr>
        <td align="left">strũlldbrųĝgs</td>
        <td></td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr>
        <td align="left">strultbrooks</td>
        <td></td>
        <td></td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr>
        <td align="left">shtruhldbrohkz</td>
        <td></td>
        <td></td>
        <td></td>
        <td>✓</td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr>
        <td align="left">zdroltbrykz</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>✓</td>
        <td>✓</td>
    </tr>
    <tr>
        <td align="left">struhlbrogger</td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td>✓</td>
    </tr>
</table>

The index size was measured after indexing the book "Gulliver's Travels".

## Fast-Update Mode

The default mode is highly optimized for search performance and adding contents to the index. Whenever you need to `update` or `remove` existing contents of an index you can enable an additional register that boosts those tasks also to a high-performance level. This register will take an extra amount of memory (~30% increase of index size).

```js
const index = new Index({
  fastupdate: true
});
```
```js
const index = new Document({
  fastupdate: true
});
```

> `Persistent`-Index does not support the `fastupdate` option, because of its nature.

When using `fastupdate: true`, the index won't fully clear up, when removing items. A barely rest of structure will still remain. It's not a memory issue, because this rest will take less than 1% of the index size. But instead the internal performance of key lookups will lose efficiency, because of not used (empty) keys in the index.

In most cases this is not an issue. But you can trigger a `index.cleanup()` task, which will find those empty index slots and remove them:

```js
index.cleanup();
```

> The `cleanup` method has no effect when not using `fastupdate: true`.

## Context Search

The basic idea of this concept is to limit relevance by its context instead of calculating relevance through the whole distance of its corresponding document. The context acts like a bidirectional moving window of 2 pointers (terms) which can initially have a maximum distance of the value passed via option setting `depth` and dynamically growth on search when the query did not match any results.

<p align="center">
    <br>
    <img src="doc/context-index.svg" width="100%" style="max-width: 700px;" alt="FlexSearch Context-based Scoring (Full-text Search)">
</p>

### Enable Context-Search

Create an index and use the default context:
```js
var index = new FlexSearch({
    tokenize: "strict",
    context: true
});
```

Create an index and apply custom options for the context:
```js
var index = new FlexSearch({
    tokenize: "strict",
    context: { 
        resolution: 5,
        depth: 3,
        bidirectional: true
    }
});
```

> Only the tokenizer `strict` is actually supported by the context index.

> The context index requires <a href="#memory">additional amount of memory</a> depending on passed property `depth`.

### Compare Context Search

Pay attention to the numbers "1", "2" and "3":

```js
const index = new Index();
index.add(1, "1 A B C D 2 E F G H I 3 J K L");
index.add(2, "A B C D E F G H I J 1 2 3 K L");
const result = index.search("1 2 3");
// --> [1, 2]
```

Same example with context enabled:

```js
const index = new Index({ context: true });
index.add(1, "1 A B C D 2 E F G H I 3 J K L");
index.add(2, "A B C D E F G H I J 1 2 3 K L");
const result = index.search("1 2 3");
// --> [2, 1]
```

The first index returns ID 1 in the first slot for the best pick, because matched terms are closer to the document root. The 2nd index has context enabled and returns the ID 2 in the first slot, because of the shorter distance between terms.

### Context Options

<table>
    <tr></tr>
    <tr>
        <td>Option</td>
        <td>Values</td>
        <td>Description</td>
        <td>Default</td>
    </tr>
    <tr>
        <td>resolution</td>
        <td>
            Number
        </td>
        <td>Sets the scoring <a href="#resolution">resolution</a> for the context.</td>
        <td>3</td>
    </tr>
    <tr></tr>
    <tr>
        <td>depth<br><br></td>
        <td>
            false<br>
            Number
        </td>
        <td>Enable/Disable context index and also sets the maximum initial distance of related terms.</td>
        <td>1</td>
    </tr>
    <tr></tr>
    <tr>
        <td>bidirectional</td>
        <td>
            Boolean
        </td>
        <td>If enabled the context direction (aka "context chain") can move bidirectional. You should ony disable this options when you need a more exact match with fewer results.</td>
        <td>true</td>
    </tr>
</table>

## Auto-Balanced Cache (By Popularity)

You need to initialize the cache and its limit of available cache slots during the creation of the index:

```js
const index = new Index({ cache: 100 });
```

> The method `.searchCache(query)` is available for each type of index.

```js
const results = index.searchCache(query);
```

> The cache automatically balance stored entries related to their popularity.

The cache also stores latest queries. A common scenario is an autocomplete or instant search when typing.

## Index Memory Allocation

The book "Gulliver's Travels" (Swift Jonathan 1726) was indexed for this test.

by default a lexical index is very small:<br>
`depth: 0, bidirectional: 0, resolution: 3, minlength: 0` => 2.1 Mb

a higher resolution will increase the memory allocation:<br>
`depth: 0, bidirectional: 0, resolution: 9, minlength: 0` => 2.9 Mb

using the contextual index will increase the memory allocation:<br>
`depth: 1, bidirectional: 0, resolution: 9, minlength: 0` => 12.5 Mb

a higher contextual depth will increase the memory allocation:<br>
`depth: 2, bidirectional: 0, resolution: 9, minlength: 0` => 21.5 Mb

a higher minlength will decrease memory allocation:<br>
`depth: 2, bidirectional: 0, resolution: 9, minlength: 3` => 19.0 Mb

using bidirectional will decrease memory allocation:<br>
`depth: 2, bidirectional: 1, resolution: 9, minlength: 3` => 17.9 Mb

enable the option "fastupdate" will increase memory allocation:<br>
`depth: 2, bidirectional: 1, resolution: 9, minlength: 3` => 6.3 Mb

## Presets

1. `memory` primarily optimized for a small memory footprint
2. `performance` primarily optimized for high performance
3. `match` primarily optimized for matching capabilities
4. `score` primarily optimized for scoring capabilities (order of results)
5. `default` the default balanced profile

These profiles are covering standard use cases. It is recommended to apply custom configuration instead of using profiles to get the best out. Every profile could be optimized further to its specific task, e.g. extreme performance optimized configuration or extreme memory and so on.

You can pass a preset during creation/initialization of the index.

## Best Practices

### Page-Load / Fast-Boot

There are several options to optimize either the page load or when booting up or populate an index on server-side:

- Using [Fast-Boot Serialization](doc/export-import.md#fast-boot-serialization-for-server-side-rendering-php-python-ruby-rust-java-go-nodejs-) for small and simple indexes
- Using [Non-Blocking Runtime Balancer (Async)](doc/async.md) for populating larger amounts of contents while doing other processes in parallel
- Using [Worker Indexes](doc/worker.md) will distribute the workload to dedicated balanced threads
- Using [Persistent Indexes](doc/persistent.md) when targeting a zero-latency boot-up

### Use numeric IDs

It is recommended to use id values from type `number` as reference when adding content to the index. The reserved byte length of passed ids influences the memory consumption significantly. When stringified numeric IDs are included in your datasets consider replacing these by `parseInt(...)` before pushing to the index.

---

Copyright 2018-2025 Thomas Wilkerling, Hosted by Nextapps GmbH<br>
Released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 License</a><br>


================================================
FILE: SECURITY.md
================================================
# Security Policy

## Supported Versions

| Version | Supported          |
| ------- | ------------------ |
| 0.8.x   | :white_check_mark: |
| 0.7.x   | :x:                |
| < 0.7   | :x:                |

## Reporting a Vulnerability

Just create an issue or pull request on Github.

> The vulnerability has to be a part of the basic installment e.g. when install by `npm install flexsearch`.
> Every vulnerability which is included by any of the `devDependencies` probably won't be fixed.


================================================
FILE: demo/autocomplete.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, shrink-to-fit=no, minimal-ui">
    <title>Demo: Auto-Complete</title>
    <style>
        body{
            padding: 0;
            margin: 0 10px;
            font-family: Helvetica, Arial, sans-serif;
            font-size: 14px;
        }
        #header{
            position: fixed;
            top: 10px;
            left: 10px;
            width: 100%;
            display: flex;
            justify-content: flex-start;
            flex-direction: row;
            max-width: 500px;
            table-layout: fixed;
            background-color: #fff;
            z-index: 1;
        }
        input[type="text"]{
            width: 100%;
            border: 1px solid #ddd;
            border-radius: 4px;
            outline: none;
            background-color: transparent;
            position: absolute;
            -webkit-appearance: none;
            z-index: 1;
        }
        #autocomplete{
            color: #999;
            background-color: #f5f5f5;
            pointer-events: none;
        }
        #select-prev,
        #select-next{
            z-index: 0;
        }
        input{
            padding:7px 5px;
            box-sizing: border-box;
        }
        #suggestions{
            position: relative;
            top: 50px;
        }
        #suggestions div{
            padding: 10px 8px;
            border-bottom: 1px solid #ddd;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            width: calc(100% - 16px);
        }
        #suggestions b{
            color: blue;
        }
        #suggestions:empty:before{
            content: "No resuls found";
            font-size: 12px;
            color: #999;
            margin-left: 7px;
        }
        #info{
            position: absolute;
            bottom: 7px;
            left: 12px;
            color: #888;
        }
        label{
            width: 100px;
            height: 32px;
            display: flex;
            align-items: center;
            margin: 0 10px;
        }
        @media only screen and (max-width: 600px) {
            body{
                font-size: 12px;
            }
        }
    </style>
</head>
<body>
<div id="header">
    <form style="position: relative; width: 100%;">
        <input type="text" id="select-prev" tabindex="1">
        <input type="text" id="autocomplete" readonly>
        <input type="text" id="userinput" tabindex="2" placeholder="Search by movie title ..." autocorrect="off" spellcheck="false" autocomplete="off" autofocus>
        <input type="text" id="select-next" tabindex="3">
    </form>
    <label>
        <input type="checkbox" id="suggest" checked> Suggest
    </label>
</div>
<!-- Iterate through results by arrow keys -->
<div id="suggestions"></div>
<script type="module">

    // Features:
    // 1. Instant Search
    // 2. Auto-Complete
    // 3. Suggestions
    // 4. Query Cache
    // 5. Result Highlighting
    // 6. Tokenizer
    // 7. Encoder
    // 8. Document Index (Field-Search)
    // 9. Keyboard Navigation

    import { Document } from "https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@master/dist/flexsearch.compact.module.min.js";
    import data from "https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@master/demo/data/movies.js";

    // for "Result Highlighting" it requires the usage of a Document Index
    // also when just adding id-content-pairs to a single index
    const index = new Document({
        document: {
            // storing documents is required in this example
            store: true,
            index: [{
                field: "title",
                // important: a forward tokenizer is minimum
                // required by an instant search
                tokenize: "forward"
            }]
        }
    });

    // The movies.js data used in this example is an array of strings.
    // Since result highlighting needs a Document Index, the data
    // has to be simply upgraded to a pseudo document.

    for(let i = 0; i < data.length; i++){
        // pass a json-like object
        index.add(i, {
            "title": data[i]
        });
    }

    const suggestions = document.getElementById("suggestions");
    const autocomplete = document.getElementById("autocomplete");
    const userinput = document.getElementById("userinput");
    const suggest = document.getElementById("suggest");
    const select_prev = document.getElementById("select-prev");
    const select_next = document.getElementById("select-next");
    let results = [];
    let iterate = 0;

    userinput.addEventListener("input", show_results, true);
    userinput.addEventListener("keyup", accept_autocomplete, true);
    userinput.addEventListener("keydown", iterate_selected, true);
    suggest.addEventListener("change", toggle_suggest, true);
    suggestions.addEventListener("click", accept_suggestion, true);

    select_prev.addEventListener("focus", function(){
        iterate_selected({ key: "ArrowUp" });
        userinput.focus();
    }, true);

    select_next.addEventListener("focus", function(){
        iterate_selected({ key: "ArrowDown" });
        userinput.focus();
    }, true);

    function toggle_suggest(){
        // changing any of the search options requires
        // deletion of cached results (when using cache)
        index.cache.clear();
        show_results();
    }

    function show_results(){

        // the cache is a perfect addition
        // for an instant search on keypress

        results = userinput.value ? index.searchCache({
            query: userinput.value,
            suggest: suggest.checked,
            limit: 25,
            pluck: "title",
            enrich: true,
            highlight: "<b>$1</b>"
        }) : [];

        let entry, childs = suggestions.childNodes;
        let i = 0, len = results.length;

        for(; i < len; i++){

            entry = childs[i];

            if(!entry){
                entry = document.createElement("div");
                suggestions.appendChild(entry);
            }

            entry.innerHTML = results[i].highlight; //data[results[i]];
        }

        while(childs.length > len){
            suggestions.removeChild(childs[i]);
        }

        select_result(0);
        iterate_selected();
    }

    function iterate_selected(event){

        let index = iterate;

        if(event){
            const key = event.key;
            if(key === "ArrowUp"){
                if(iterate > 0){
                    select_result(--index);
                }
                event.preventDefault &&
                event.preventDefault();
            }
            else if(key === "ArrowDown"){
                if(iterate < results.length){
                    select_result(++index);
                }
                event.preventDefault &&
                event.preventDefault();
            }
        }

        let value = userinput.value;
        let first_result = results && results[index] && data[results[index].id];
        let match = first_result && first_result.toLowerCase().indexOf(value.toLowerCase());

        if(first_result && (match > -1)){
            autocomplete.value = value + first_result.substring(match + value.length);
            autocomplete.current = first_result;
        }
        else{
            autocomplete.value = autocomplete.current = value;
        }
    }

    function select_result(index){

        let node = suggestions.childNodes[iterate];
        node && (node.style.backgroundColor = "");

        iterate = index;

        node = suggestions.childNodes[iterate];
        node && (node.style.backgroundColor = "rgba(0, 0, 255, 0.1)");
    }

    function accept_autocomplete(event){

        const key = (event || window.event).keyCode;

        if(key === 13 || key === 39) {
            const node = suggestions.childNodes[iterate];
            if(!node) return;
            userinput.value = autocomplete.value = node.textContent;
            suggestions.textContent = "";
        }
    }

    function accept_suggestion(event){

        const target = (event || window.event).target;
        userinput.value = autocomplete.value = target.textContent;
        suggestions.textContent = "";

        return false;
    }
</script>
</body>
</html>


================================================
FILE: demo/data/gulliver.js
================================================
export const text_queries = "gulliver;great;country;time;people;little;master;took;feet;houyhnhnms".split(";");
export const text_queries_multi = "italians homunceletino;theodorus vangrult;virtuous houyhnhnms;creature discovered;lord high chancellor".split(";");
export const text_data = "LIBRARY OF THE FUTURE (R) First Edition Ver. 4.02 Gulliver's Travels Swift Jonathan 1726 GULLIVER'S TRAVELS by Jonathan Swift Electronically Enhanced Text (c) Copyright 1991, World Library, Inc. LETTER_TO_SYMPSON A LETTER FROM CAPTAIN GULLIVER TO HIS COUSIN SYMPSON - I hope you will be ready to own publicly, whenever you shall be called to it, that by your great and frequent urgency you prevailed on me to publish a very loose and uncorrect account of my travels; with direction to hire some young gentlemen of either university to put them in order, and correct the style, as my cousin Dampier did by my advice, in his book called A Voyage round the World. But I do not remember I gave you power to consent that any thing should be omitted, and much less that any thing should be inserted: therefore, as to the latter, I do here renounce every thing of that kind; particularly a paragraph about her Majesty the late Queen Anne, of most pious and glorious memory; although I did reverence and esteem her more than any of human species. But you, or your interpolator, ought to have considered, that as it was not my inclination, so was it not decent to praise any animal of our composition before my master Houyhnhnm: and besides the fact was altogether false; for to my knowledge, being in England during some part of her Majesty's reign, she did govern by a chief minister; nay, even by two successively; the first whereof was the Lord of Godolphin, and the second the Lord of Oxford; so that you have made me say the thing that was not. Likewise, in the account of the Academy of Projectors, and several passages of my discourse to my master Houyhnhnm, you have either omitted some material circumstances, or minced or changed them in such a manner, that I do hardly know my own work. When I formerly hinted to you something of this in a letter, you were pleased to answer that you were afraid of giving offense; that people in power were very watchful over the press, and apt not only to interpret, but to punish every thing which looked like an innuendo (as I think you called it). But pray, how could that which I spoke so many years ago, and at about five thousand leagues distance, in another reign, be applied to any of the Yahoos who now are said to govern the herd; especially at a time when I little thought on or feared the unhappiness of living under them? Have not I the most reason to complain, when I see these very Yahoos carried by Houyhnhnms in a vehicle, as if these were brutes, and those the rational creatures? And indeed, to avoid so monstrous and detestable a sight was one principal motive of my retirement hither. Thus much I thought proper to tell you in relation to yourself, and to the trust I reposed in you. I do in the next place complain of my own great want of judgement, in being prevailed upon by the entreaties and false reasonings of you and some others, very much against my own opinion, to suffer my travels to be published. Pray bring to your mind how often I desired you to consider, when you insisted on the motive of public good; that the Yahoos were a species of animals utterly incapable of amendment by precepts or examples: and so it hath proved; for instead of seeing a full stop put to all abuses and corruptions, at least in this little island, as I had reason to expect: behold, after above six months warning, I cannot learn that my book hath produced one single effect according to my intentions: I desired you would let me know by a letter, when party and faction were extinguished; judges learned and upright; pleaders honest and modest, with some tincture of common sense; and Smithfield blazing with pyramids of lawbooks; the young nobility's education entirely changed; the physicians banished; the female Yahoos abounding in virtue, honour, truth and good sense; courts and levees of great ministers thoroughly weeded and swept; wit, merit and learning rewarded; all disgracers of the press in prose and verse condemned to eat nothing but their own cotton, and quench their thirst with their own ink. These and a thousand other reformations, I firmly counted upon by your encouragement; as indeed they were plainly deducible from the precepts delivered in my book. And it must be owned that seven months were a sufficient time to correct every vice and folly to which Yahoos are subject, if their natures had been capable of the least disposition to virtue or wisdom: yet so far have you been from answering my expectation in any of your letters, that on the contrary you are loading our carrier every week with libels, and keys, and reflections, and memoirs, and second parts; wherein I see myself accused of reflecting upon great states-folk, of degrading human nature (for so they have still the confidence to style it), and of abusing the female sex. I find likewise that the writers of those bundles are not agreed among themselves; for some of them will not allow me to be author of my own travels; and others make me author of books to which I am wholly a stranger. I find likewise that your printer hath been so careless as to confound the times, and mistake the dates of my several voyages and returns; neither assigning the true year, or the true month, or day of the month: and I hear the original manuscript is all destroyed since the publication of my book. Neither have I any copy left: however I have sent you some corrections, which you may insert, if ever there should be a second edition: and yet I cannot stand to them, but shall leave that matter to my judicious and candid readers, to adjust it as they please. I hear some of our sea-Yahoos find fault with my sea-language, as not proper in many parts, nor now in use. I cannot help it. In my first voyages, while I was young, I was instructed by the oldest mariners, and learned to speak as they did. But I have since found that the sea-Yahoos are apt, like the land ones, to become new-fangled in their words, which the latter change every year, insomuch as I remember upon each return to my own country their old dialect was so altered that I could hardly understand the new. And I observe, when any Yahoo comes from London out of curiosity visit me at my own house, we neither of us are able to deliver our conceptions in a manner intelligible to the other. {LETTER_TO_SYMPSON ^paragraph 5} If the censure of Yahoos could any way affect me, I should have great reason to complain that some of them are so bold as to think my book of travels a mere fiction out of my own brain, and have gone so far as to drop hints that the Houyhnhnms and Yahoos have no more existence than the inhabitants of Utopia. Indeed I must confess, that as to the people of Lilliput, Brobdingrag (for so the word should have been spelt, and not erroneously Brobdingnag), and Laputa, I have never yet heard of any Yahoo so presumptuous as to dispute their being, or the facts I have related concerning them; because the truth immediately strikes every reader with conviction. And is there less probability in my account of the Houyhnhnms or Yahoos, when it is manifest as to the latter, there are so many thousands even in this city, who only differ from their brother brutes in Houyhnhnm-land, because they use a sort of a jabber, and do not go naked? I wrote for their amendment, and not their approbation. The united praise of the whole race would be of less consequence to me than the neighing of those two degenerate Houyhnhnms I keep in my stable; because from these, degenerate as they are, I still improve in some virtues, without any mixture of vice. Do these miserable animals presume to think that I am so far degenerated as to defend my veracity? Yahoo as I am, it is well known through all Houyhnhnm-land, that by the instructions and example of my illustrious master I was able in the compass of two years (although I confess with the utmost difficulty) to remove that infernal habit of lying, shuffling, deceiving, and equivocating, so deeply rooted in the very souls of all my species, especially the Europeans. I have other complaints to make upon this vexatious occasion; but I forbear troubling myself or you any further. I must freely confess, that since my last return some corruptions of my Yahoo nature have revived in me by conversing with a few of your species, and particularly those of my own family, by an unavoidable necessity; else I should never have attempted so absurd a project as that of reforming the Yahoo race in this kingdom; but I have now done with all visionary schemes for ever. - - April 2, 1727. PUBLISHERS_LETTER THE PUBLISHER TO THE READER - The author of these Travels, Mr. Lemuel Gulliver, is my ancient and intimate friend; there is likewise some relation between us by the mother's side. About three years ago Mr. Gulliver, growing weary of the concourse of curious people coming to him at his house in Redriff, made a small purchase of land, with a convenient house, near Newark in Nottinghamshire, his native country; where he now lives retired, yet in good esteem among his neighbors. Although Mr. Gulliver was born in Nottinghamshire, where his father dwelt, yet I have heard him say his family came from Oxfordshire; to confirm which, I have observed in the churchyard at Banbury, in that county, several tombs and monuments of the Gullivers. Before he quitted Redriff, he left the custody of the following papers in my hands, with the liberty to dispose of them as I should think fit. I have carefully perused them three times: the style is very plain and simple; and the only fault I find is, that the author, after the manner of travelers, is a little too circumstantial. There is an air of truth apparent through the whole; and indeed the author was so distinguished for his veracity, that it became a sort of proverb among his neighbors at Redriff, when any one affirmed a thing, to say it was as true as if Mr. Gulliver had spoke it. By the advice of several worthy persons, to whom, with the author's permission, I communicated these papers, I now venture to send them into the world, hoping they may be at least, for some time, a better entertainment to our young noblemen than the common scribbles of politics and party. This volume would have been at least twice as large, if I had not made bold to strike out innumerable passages relating to the winds and tides, as well as to the variations and bearings in the several voyages; together with the minute descriptions of the management of the ship in storms, in the style of sailors: likewise the account of the longitudes and latitudes; wherein I have reason to apprehend that Mr. Gulliver may be a little dissatisfied: but I was resolved to fit the work as much as possible to the general capacity of readers. However, if my own ignorance in sea-affairs shall have led me to commit some mistakes, I alone am answerable for them: and if any traveler hath a curiosity to see the whole work at large, as it came from the hand of the author, I shall be ready to gratify him. {PUBLISHERS_LETTER ^paragraph 5} As for any further particulars relating to the author, the reader will receive satisfaction from the first pages of the book. - Richard Sympson. PART I A VOYAGE TO LILLIPUT (SEE PLATE 1) P_1|CH_1 CHAPTER I - My father had a small estate in Nottinghamshire; I was the third of five sons. He sent me to Emanuel College in Cambridge at fourteen years old, where I resided three years, and applied myself close to my studies: but the charge of maintaining me (although I had a very scanty allowance) being too great for a narrow fortune, I was bound apprentice to Mr. James Bates, an eminent surgeon in London, with whom I continued four years; and my father now and then sending me small sums of money, I laid them out in learning navigation, and other parts of the mathematics, useful to those who intend to travel, as I always believed it would be some time or other my fortune to do. When I left Mr. Bates, I went down to my father; where, by the assistance of him and my uncle John, and some other relations, I got forty pounds, and a promise of thirty pounds a year to maintain me at Leyden: there I studied physic two years and seven months, knowing it would be useful in long voyages. Soon after my return from Leyden, I was recommended, by my good master Mr. Bates, to be surgeon to the Swallow, Captain Abraham Pannell commander; with whom I continued three years and a half, making a voyage or two into the Levant, and some other parts. When I came back, I resolved to settle in London, to which Mr. Bates, my master, encouraged me, and by him I was recommended to several patients. I took part of a small house in the Old Jury; and being advised to alter my condition, I married Mrs. Mary Burton, second daughter to Mr. Edmund Burton, hosier, in Newgate-street, with whom I received four hundred pounds for a portion. But, my good master Bates dying in two years after, and I having few friends, my business began to fail; for my conscience would not suffer me to imitate the bad practice of too many among my brethren. Having therefore consulted with my wife, and some of my acquaintance, I determined to go again to sea. I was surgeon successively in two ships, and made several voyages, for six years, to the East and West Indies, by which I got some addition to my fortune. My hours of leisure I spent in reading the best authors, ancient and modern, being always provided with a good number of books; and when I was ashore, in observing the manners and dispositions of the people, well as learning their language, wherein I had a great facility by the strength of my memory. The last of these voyages not proving very fortunate, I grew weary of the sea, and intended to stay at home with my wife and family. I removed from the Old jury to Fetter-Lane, and from thence to Wapping hoping to get business among the sailors; but it would not turn to account. After three years expectation that things would mend, I accepted an advantageous offer from Captain William Prichard, master of the Antelope, who was making a voyage to the South-Sea. We set sail from Bristol May 4, 1699, and our voyage at first was very prosperous. It would not be proper, for some reasons, to trouble the reader with the particulars of our adventures in those seas: let it suffice to inform him, that in our passage from thence to the East Indies, we were driven by a violent storm to the northwest of Van Diemen's Land. By an observation, we found ourselves in the latitude of 30 degrees 2 minutes south. Twelve of our crew were dead by immoderate labor and ill food, the rest were in a very weak condition. On the fifth of November, which was the beginning of summer in those parts, the weather being very hazy, the seamen spied a rock, within half a cable's length of the ship; but the wind was so strong, that we were driven directly upon it, and immediately split. Six of the crew, of whom I was one, having let down the boat into the sea, made a shift to get clear of the ship, and the rock. We rowed by my computation about three leagues, till we were able to work no longer, being already spent with labor while we were in the ship. We therefore trusted ourselves to the mercy of the waves, and in about half an hour the boat was overset by a sudden flurry from the north. What became of my companions in the boat, as well as of those who escaped on the rock, or were left in the vessel, I cannot tell; but conclude they were all lost. For my own part, I swam as fortune directed me, and was pushed forward by wind and tide. I often let my legs drop, and could feel no bottom: but when I was almost gone, and able to struggle no longer, I found myself within my depth; and by this time the storm was much abated. The declivity was so small, that I walked near a mile before I got to the shore, which I conjectured was about eight o'clock in the evening. I then advanced forward near half a mile, but could not discover any sign of houses or inhabitants; at least I was in so weak a condition, that I did not observe them. I was extremely tired, and with that, and the heat of the weather, and about half a pint of brandy that I drank as I left the ship, I found myself much inclined to sleep. I lay down on the grass, which was very short and soft, where I slept sounder than ever I remember to have done in my life, and, as I reckoned, above nine hours; for when I awakened, it was just daylight. I attempted to rise, but was not able to stir for, as I happened to he on my back, I found my arms and legs were strongly fastened on each side to the ground; and my hair, which was long and thick, tied down in the same manner. I likewise felt several slender ligatures across my body, from my armpits to my thighs. I could only look upwards; the sun began to grow hot, and the light offended my eyes. I heard a confused noise about me, but in the posture I lay, could see nothing except the sky. In a little time I felt something alive moving on my left leg, which advancing gently forward over my breast, came almost up to my chin; when bending my eyes downwards as much as I could, I perceived it to be a human creature not six inches high, with a bow and arrow in his hands, and a quiver at his back. In the meantime, I felt at least forty more of the same kind (as I conjectured) following the first. I was in the utmost astonishment, and roared so loud, that they all ran back in a fright; and some of them, as I was afterwards told, were hurt with the falls they got by leaping from my sides upon the ground. However, they soon returned, and one of them, who ventured so far as to get a full sight of my face, lifting up his hands and eyes by way of admiration, cried out in a shrill but distinct voice, Hekinah degul: the others repeated the same words several times, but I then knew not what they meant. I lay all this while, as the reader may believe, in great uneasiness: at length, struggling to get loose, I had the fortune to break the strings, and wrench out the pegs that fastened my left arm to the ground; for, by lifting it up to my face, I discovered the methods they had taken to bind me, and at the same time, with a violent pull, which gave me excessive pain, I a little loosened the strings that tied down my hair on the left side, so that I was just able to turn my head about two inches. But the creatures ran off a second time, before I could seize them; whereupon there was a great shout in a very shrill accent, and after it ceased, I heard one of them cry aloud, Tolgo phonac; when in an instant I felt above a hundred arrows discharged on my left hand, which pricked me like so many needles; and besides they shot another flight into the air, as we do bombs in Europe, whereof many, I suppose, fell on my body (though I felt them not) and some on my face, which I immediately covered with my left hand. When this shower of arrows was over, I fell a groaning with grief and pain, and then striving again to get loose, they discharged another volley larger than the first, and some of them attempted with spears to stick me in the sides; but, by good luck, I had on me a buff jerkin, which they could not pierce. I thought it the most prudent method to lie still, and my design was to continue so till night, when, my left hand being already loose, I could easily free myself: and as for the inhabitants, I had reason to believe I might be a match for the greatest armies they could bring against me, if they were all of the same size with him that I saw. But fortune disposed otherwise of me. When the people observed I was quiet, they discharged no more arrows; but, by the noise I heard, I knew their numbers increased; and about four yards from me, over against my right ear, I heard a knocking for above an hour, like that of people at work; when turning my head that way, as well as the pegs and strings would permit me, I saw a stage erected, about a foot and a half from the ground, capable of holding four of the inhabitants, with two or three ladders to mount it: from whence one of them, who seemed to be a person of quality, made me a long speech, whereof I understood not one syllable. But I should have mentioned, that before the principal person began his oration, he cried out three times, Langro dehul san (these words and the former were afterwards repeated and explained to me). Whereupon immediately about fifty of the inhabitants came, and cut the strings that fastened the left side of my head, which gave me the liberty of turning it to the right, and of observing the person and gesture of him that was to speak. He appeared to be of a middle age, and taller than any of the other three who attended him, whereof one was a page that held up his train, and seemed to be somewhat longer than my middle finger; the other two stood one on each side to support him. He acted every part of an orator, and I could observe many periods of threatenings, and others of promises, pity, and kindness. I answered in a few words, but in the most submissive manner, lifting up my left hand and both my eyes to the sun, as calling him for a witness; and being almost famished with hunger, having not eaten a morsel for some hours before I left the ship, I found the demands of nature so strong upon me, that I could not forbear showing my impatience (perhaps against the strict rules of decency) by putting my finger frequently on my mouth, to signify that I wanted food. The Hurgo (for so they call a great lord, as I afterwards learned) understood me very well. He descended from the stage, and commanded that several ladders should be applied to my sides, on which above a hundred of the inhabitants mounted, and walked towards my mouth, laden with baskets full of meat, which had been provided, and sent thither by the King's orders, upon the first intelligence he received of me. I observed there was the flesh of several animals, but could not distinguish them by the taste. There were shoulders, legs, and loins, shaped like those of mutton, and very well dressed, but smaller than the wings of a lark. I ate them by two or three at a mouthful, and took three loaves at a time, about the bigness of musket bullets. They supplied me as they could, showing a thousand marks of wonder and astonishment at my bulk and appetite. I then made another sign that I wanted drink. They found by my eating that a small quantity would not suffice me, and being a most ingenious people, they slung up with great dexterity one of their largest hogsheads, then rolled it toward my hand, and beat out the top; I drank it off at a draught, which I might well do, for it did not hold half a pint, and tasted like a small wine of Burgundy, but much more delicious. They brought me a second hogshead, which I drank in the same manner, and made signs for more, but they had none to give me. When I had performed these wonders, they shouted for joy, and danced upon my breast, repeating several times as they did at first, Hekinah degul. They made me a sign that I should throw down the two hogsheads, but first warning the people below to stand out of the way, crying aloud, Borach mivola, and when they saw the vessels in the air, there was a universal shout of Hekinah degul. I confess I was often tempted, while they were passing backwards and forwards on my body, to seize forty or fifty of the first that came in my reach, and dash them against the ground. But the remembrance of what I had felt, which probably might not be the worst they could do, and the promise of honor I made them, for so I interpreted my submissive behavior, soon drove out these imaginations. Besides, I now considered myself as bound by the laws of hospitality to a people who had treated me with so much expense and magnificence. However, in my thoughts I could not sufficiently wonder at the intrepidity of these diminutive mortals, who dare venture to mount and walk upon my body, while one of my hands was at liberty, without trembling at the very sight of so prodigious a creature as I must appear to them. After some time, when they observed that I made no more demands for meat, there appeared before me a person of high rank from his Imperial Majesty. His Excellency, having mounted on the small of my right leg, advanced forwards up to my face, with about a dozen of his retinue. And producing his credentials under the Signet Royal, which he applied close to my eyes, spoke about ten minutes, without any signs of anger, but with a kind of determinate resolution; often pointing forwards, which, as I afterwards found, was towards the capital city, about half a mile distant, whither it was agreed by his Majesty in council that I must be conveyed. I answered in few words, but to no purpose, and made a sign with my hand that was loose, putting it to the other (but over his Excellency's head, for fear of hurting him or his train) and then to my own head and body, to signify that I desired my liberty. It appeared that he understood me well enough, for he shook his head by way of disapprobation, and held his hand in a posture to show that I must be carried as a prisoner. However, he made other signs to let me understand that I should have meat and drink enough, and very good treatment. Whereupon I once more thought of attempting to break my bonds, but again, when I felt the smart of their arrows upon my face and hands, which were all in blisters, and many of the darts still sticking in them, and observing likewise that the number of my enemies increased, I gave tokens to let them know that they might do with me what they pleased. Upon this the Hurgo and his train withdrew with much civility and cheerful countenances. Soon after I heard a general shout, with frequent repetitions of the words, Peplom selan, and I felt great numbers of the people on my left side relaxing the cords to such a degree, that I was able to turn upon my right, and to ease myself with making water; which I very plentifully did, to the great astonishment of the who conjecturing by my motions what I was going to do, immediately opened to the right and left on that side, to avoid the torrent which fell with such noise and violence from me. But before this, they had daubed my face and both my hands with a sort of ointment very pleasant to the smell, which in a few minutes removed all the smart of their arrows. These circumstances, added to the refreshment I had received by their victuals and drink, which were very nourishing, disposed me to sleep. I slept about eight hours, as I was afterwards assured; and it was no wonder, for the physicians, by the Emperor's order, had mingled a sleepy potion in the hogsheads of wine. {P_1|CH_1 ^paragraph 5} It seems that upon the first moment I was discovered sleeping on the ground after my landing, the Emperor had early notice of it by an express; and determined in council that I should be tied in the manner I have related (which was done in the night while I slept), that plenty of meat and drink should be sent me, and a machine prepared to carry me to the capital city. This resolution perhaps may appear very bold and dangerous, and I am confident would not be imitated by any prince in Europe on the like occasion; however, in my opinion, it was extremely prudent, as well as generous. For supposing these people had endeavored to kill me with their spears and arrows while I was asleep, I should certainly have awakened with the first sense of smart, which might so far have roused my rage and strength, as to have enabled me to break the strings wherewith I was tied; after which, as they were not able to make resistance, so they could expect no mercy. These people are most excellent mathematicians, and arrived to great perfection in mechanics by the countenance and encouragement of the Emperor, who is a renowned patron of learning. This prince has several machines fixed on wheels for the carriage of trees and other great weights. He often builds his largest men of war, whereof some are nine feet long, in the woods where the timber grows, and has them carried on these engines three or four hundred yards to the sea. Five hundred carpenters and engineers were immediately set at work to prepare the greatest engine they had. It was a frame of wood raised three inches from the ground, about seven feet long and four wide, moving upon twenty-two wheels. The shout I heard was upon the arrival of this engine, which it seems set out in four hours after my landing. It was brought parallel to me as I lay. But the principal difficulty was to raise and place me in this vehicle. Eighty poles, each of one foot high, were erected for this purpose, and very strong cords of the bigness of packthread were fastened by hooks to many bandages, which the workmen had girt round my neck, my hands, my body, and my legs. Nine hundred of the strongest men were employed to draw up these cords by many pulleys fastened on the poles, and thus, in less than three hours, I was raised and slung into the engine, and there tied fast. All this I was told, for while the whole operation was performing, I lay in a profound sleep, by the force of that soporiferous medicine infused into my liquor. Fifteen hundred of the Emperor's largest horses, each about four inches and a half high, were employed to draw me towards the metropolis, which, as I said, was half a mile distant. About four hours after we began our journey, I awaked by a very ridiculous accident; for the carriage being stopped a while to adjust something that was out of order, two or three of the young natives had the curiosity to see how I looked when I was asleep; they climbed up into the engine, and advancing very softly to my face, one of them, an officer in the Guards, put the sharp end of his half-pike a good way up into my left nostril, which tickled my nose like a straw, and made me sneeze violently: whereupon they stole off unperceived, and it was three weeks before I knew the cause of my awaking so suddenly. We made a long march the remaining part of that day, and rested at night with five hundred guards on each side of me, half with torches, and half with bows and arrows, ready to shoot me if I should offer to stir. The next morning at sunrise we continued our march, and arrived within two hundred yards of the city gates about noon. The Emperor, and all his court, came out to meet us; but his great officers would by no means suffer his Majesty to endanger his person by mounting on my body. At the place where the carriage stopped, there stood an ancient temple, esteemed to be the largest in the whole kingdom, which having been polluted some years before by an unnatural murder, was, according to the zeal of those people, looked on as profane, and therefore had been applied to common uses, and all the ornaments and furniture carried away. In this edifice it was determined I should lodge. The great gate fronting to the north was about four feet high, and almost two feet wide, through which I could easily creep. On each side of the gate was a small window not above six inches from the ground: into that on the left side, the King's smiths conveyed fourscore and eleven chains, like those that hang to a lady's watch in Europe, and almost as large, which were locked to my left leg with six and thirty padlocks. Over against this temple, on the other side of the great highway, at twenty feet distance, there was a turret at least five feet high. Here the Emperor ascended with many principal lords of his court, to have an opportunity of viewing me, as I was told, for I could not see them. It was reckoned that above a hundred thousand inhabitants came out of the town upon the same errand; and in spite of my guards, I believe there could not be fewer than ten thousand, at several times, who mounted upon my body by the help of ladders. But a proclamation was soon issued to forbid it upon pain of death. When the workmen found it was impossible for me to break loose, they cut all the strings that bound me; whereupon I rose up with as melancholy a disposition as ever I had in my life. But the noise and astonishment of the people at seeing me rise and walk, are not to be expressed. The chains that held my left leg were about two yards long, and gave me not only the liberty of walking backwards and forwards in a semi-circle; but, being fixed within four inches of the gate, allowed me to creep in, and lie at my full length in the temple. P_1|CH_2 CHAPTER II - When I found myself on my feet, I looked about me, and must confess I never beheld a more entertaining prospect. The country round appeared like a continued garden, and the inclosed fields, which were generally forty feet square, resembled so many beds of flowers. These fields were intermingled with woods of half a sting, and the tallest trees, as I could judge, appeared to be seven feet high. I viewed the town on my left hand, which looked like the painted scene of a city in a theatre. I had been for some hours extremely pressed by the necessities of nature; which was no wonder, it being almost two days since I had last unburdened myself. I was under great difficulties between urgency and shame. The best expedient I could think of, was to creep into my house, which I accordingly did; and shutting the gate after me, I went as far as the length of my chain would suffer, and discharged my body of that uneasy load. But this was the only time I was ever guilty of so uncleanly an action; for which I cannot but hope the candid reader will give some allowance, after he has maturely and impartially considered my case, and the distress I was in. From this time my constant practice was, as soon as I rose, to perform that business in open air, at the full extent of my chain, and due care was taken every morning before company came, that the offensive matter should be carried off in wheelbarrows, by two servants appointed for that purpose. I would not have dwelt so long upon a circumstance, that perhaps at first sight may appear not very momentous, if I had not thought it necessary to justify my character in point of cleanliness to the world; which I am told some of my maligners have been pleased, upon this and other occasions, to call in question. When this adventure was at an end, I came back out of my house, having occasion for fresh air. The Emperor was already descended from the tower, and advancing on horseback towards me, which had like to have cost him dear; for the beast, though very well trained, yet wholly unused to such a sight, which appeared as if a mountain moved before him, he reared up on his hinder feet: but that prince, who is an excellent horseman, kept his seat, till his attendants ran in, and held the bridle, while his Majesty had time to dismount. When he alighted, he surveyed me round with great admiration, but kept without the length of my chain. He ordered his cooks and butlers, who were already prepared, to give me victuals and drink, which they pushed forward in a sort of vehicle upon wheels till I could reach them. I took these vehicles, and soon emptied them all; twenty of them were filled with meat, and ten with liquor; each of the former afforded me two or three good mouthfuls, and I emptied the liquor of ten vessels, which was contained in earthen vials, into one vehicle, drinking it off at a draught; and so I did with the rest. The Empress, and young Princes of the blood, of both sexes, attended by many ladies, sat at some distance in their chairs; but upon the accident that happened to the Emperor's horse, they alighted, and came near his person, which I am now going to describe. He is taller by almost the breadth of my nail than any of his court, which alone is enough to strike an awe into the beholders. His features are strong and masculine, with an Austrian lip and arched nose, his complexion olive, his countenance erect, his body and limbs well proportioned, all his motions graceful, and his deportment majestic. He was then past his prime, being twenty-eight years and three quarters old, of which he had reigned about seven, in great felicity, and generally victorious. For the better convenience of beholding him, I lay on my side, so that my face was parallel to his, and he stood but three yards off: however, I have had him since many times in my hand, and therefore cannot be deceived in the description. His dress was very plain and simple, and the fashion of it between the Asiatic and the European; but he had on his head a light helmet of gold, adorned with jewels, and a plume on the crest. He held his sword drawn in his hand, to defend himself, if I should happen to break loose; it was almost three inches long, the hilt and scabbard were gold enriched with diamonds. His voice was shrill, but very clear and articulate, and I could distinctly hear it when I stood up. The ladies and courtiers were all most magnificently clad, so that the spot they stood upon seemed to resemble a petticoat spread on the ground, embroidered with figures of gold and silver. His Imperial Majesty spoke often to me, and I returned answers, but neither of us could understand a syllable. There were several of his priests and lawyers present (as I conjectured by their habits) who were commanded to address themselves to me, and I spoke to them in as many languages as I had the least smattering of, which were High and Low Dutch, Latin, French, Spanish, Italian, and Lingua Franca; but all to no purpose. After about two hours the court retired, and I was left with a strong guard, to prevent the impertinence, and probably the malice of the rabble, who were very impatient to crowd about me as near as they dare, and some of them had the impudence to shoot their arrows at me as I sat on the ground by the door of my house, whereof one very narrowly missed my left eye. But the colonel ordered six of the ringleaders to be seized, and thought no punishment so proper as to deliver them bound into my hands, which some of his soldiers accordingly did, pushing them forwards with the butt-ends of their pikes into my reach; I took them all in my right hand, put five of them into my coat pocket, and as to the sixth, I made a countenance as if I would eat him alive. The poor man squalled terribly, and the colonel and his officers were in much pain, especially when they saw me take out my penknife: but I soon put them out of fear; for, looking mildly, and immediately cutting the strings he was bound with, I set him gently on the ground, and away he ran. I treated the rest in the same manner, taking them one by one out of my pocket, and I observed both the soldiers and people were highly obliged at this mark of my clemency, which was represented very much to my advantage at court. Towards night I with some difficulty got into my house, where I lay on the ground, and continued to do so about a fortnight; during which time the Emperor gave orders to have a bed prepared for me. Six hundred beds of the common measure were brought in carriages, and worked up in my house; a hundred and fifty of their beds sewn together made up the breadth and length, and these were four double, which however kept me but very indifferently from the hardness of the floor, that was of smooth stone. By the same computation they provided me with sheets, blankets, and coverlets, tolerable enough for one who had been so long inured to hardships as I. As the news of my arrival spread through the kingdom, it brought prodigious numbers of rich, idle, and curious people to see me; so that the villages were almost emptied, and great neglect of tillage and household affairs must have ensued, if his Imperial Majesty had not provided, by several proclamations and orders of state, against this inconveniency. He directed that those who had already beheld me should return home, and not presume to come within fifty yards of my house without license from court; whereby the secretaries of state got considerable fees. {P_1|CH_2 ^paragraph 5} In the meantime, the Emperor held frequent councils to debate what course should be taken with me; and I was afterwards assured by a particular friend, a person of great quality, who was looked upon to be as much in the secret as any, that the court was under many difficulties concerning me. They apprehended my breaking loose, that my diet would be very expensive, and might cause a famine. Sometimes they determined to starve me, or at least to shoot me in the face and hands with poisoned arrows, which would soon dispatch me: but again they considered, that the stench of so large a carcass might produce a plague in the metropolis, and probably spread through the whole kingdom. In the midst of these consultations, several officers of the army went to the door of the great council chamber; and two of them being admitted, gave an account of my behavior to the six criminals above mentioned, which made so favorable an impression in the breast of his Majesty and the whole board in my behalf, that an Imperial Commission was issued out, obliging all the villages nine hundred yards round the city, to deliver in every morning six beeves, forty sheep, and other victuals for my sustenance; together with a proportionable quantity of bread, and wine, and other liquors for the due payment of which his Majesty gave assignments upon his treasury. For this prince lives chiefly upon his own demesnes, seldom, except upon great occasions, raising any subsidies upon his subjects, who are bound to attend him in his wars at their own expense. An establishment was-also made of six hundred persons to be my domestics, who had board-wages allowed for their maintenance, and tents built for them very conveniently on each side of my door. It was likewise ordered, that three hundred tailors should make me a suit of clothes after the fashion of the country: that six of his Majesty's greatest scholars should be employed to instruct me in their language: and, lastly, that the Emperor's horses, and those of the nobility, and troops of guards, should be frequently exercised in my sight, to accustom themselves to me. All these orders were duly put in execution, and in about three weeks I made a great progress in learning their language; during which time the Emperor frequently honored me with his visits, and was pleased to assist my masters in teaching me. We began already to converse together in some sort; and the first words I learned were to express my desire that he would please give me my liberty, which I every day repeated on my knees. His answer, as I could apprehend it, was, that this must be a work of time, not to be thought on without the advice of his council, and that first I must Lumos kelmin pesso desmar lon Emposo; that is, swear a peace with him and his kingdom. However, that I should be used with all kindness; and he advised me to acquire, by my patience and discreet behavior, the good opinion of himself and his subjects. He desired I would not take it ill, if he gave orders to certain proper officers to search me; for probably I might carry about me several weapons, which must needs be dangerous things, if they answered the bulk of so prodigious a person. I said, his Majesty should be satisfied, for I was ready to strip myself, and turn out my pockets before him. This I delivered part in words, and part in signs. He replied, that by the laws of the kingdom I must be searched by two of his officers; that he knew this could not be done without my consent and assistance; that he had so good an opinion of my generosity and justice, as to trust their persons in my hands: that whatever they took from me should be returned when I left the country, or paid for at the rate which I would set upon them. I took up the two officers in my hands, put them first into my coat-pockets, and then into every other pocket about me, except my two fobs, and another secret pocket I had no mind should be searched, wherein I had some little necessaries that were of no consequence to any but myself. In one of my fobs there was a silver watch, and in the other a small quantity of gold in a purse. These gentlemen, having pen, ink, and paper about them, made an exact inventory of everything they saw; and when they were through, desired I would set them down, that they might deliver it to the Emperor. This inventory I afterwards translated that into English, and is word for word as follows. - Imprimis, In the right coat pocket of the Great Man Mountain (for so I interpret the words Quinbus Flestrin) after the strictest search, we found only one great piece of coarse cloth, large enough to be a foot cloth for your Majesty's chief room of state. In the left pocket we saw a huge silver chest, with a cover of the same metal, which we the searchers were not able to lift. We desired it should be opened, and one of us stepping into it, found himself up to the mid leg in a sort of dust, some part whereof flying up to our faces, set us both sneezing for several times together. In his right waistcoat pocket we found a prodigious bundle of white thin substances, folded one over another, about the bigness of three men, tied with a strong cable, and marked with black figures; which we humbly conceive to be writings, every letter almost half as large as the palm of our hands. In the left there was a sort of engine, from the back of which were extended twenty long poles, resembling the palisades before your Majesty's court; wherewith we conjecture the Man-Mountain combs his head, for we did not always trouble him with questions, because we found it a great difficulty to make him understand us. In the large pocket on the right side of his middle cover (so I translate the word ranfu-lo, by which they meant my breeches) we saw a hollow pillar of iron, about the length of a man, fastened to a strong piece of timber, larger than the pillar; and upon one side of the pillar were huge pieces of iron sticking out, cut into strange figures, which we know not what to make of. In the left pocket, another engine of the same kind. In the smaller pocket on the right side, were several round flat pieces of white and red metal, of different bulk; some of the white, which seemed to be silver, were so large and heavy, that my comrade and I could hardly lift them. In the left pocket were two black pillars irregularly shaped: we could not, without difficulty, reach the top of them as we stood at the bottom of his pocket. One of them was covered, and seemed all of a piece: but at the upper end of the other, there appeared a white round substance, about twice the bigness of our heads. Within each of these was enclosed a prodigious plate of steel; which, by our orders, we obliged him to show us, because we apprehended they might be dangerous engines. He took them out of their cases, and told us, that in his own country his practice was to shave his beard with one of these, and to cut his meat with the other. There were two pockets which we could not enter: these he called his fobs; they were two large slits cut into the top of his middle cover, but squeezed close by the pressure of his belly. Out of the right fob hung a great silver chain, with a wonderful kind of engine at the bottom. We directed him to draw out whatever was fastened to that chain; which appeared to be a globe, half silver, and half of some transparent metal: for on the transparent side we saw certain strange figures circularly drawn, and thought we could touch them, till we found our fingers stopped by that lucid substance. He put this engine to our ears, which made an incessant noise like that of a watermill: and we conjecture it is either some unknown animal, or the god that he worships; but we are more inclined to the latter opinion, because he assured us (if we understood him right, for he expressed himself very imperfectly) that he seldom did anything without consulting it: he called it his oracle, and said it pointed out the time for every action of his life. From the left fob he took out a net almost large enough for a fisherman, but contrived to open and shut like a purse, and serve him for the same use: we found therein several massy pieces of yellow metal, which, if they be real gold, must be of immense value. Having thus, in obedience to your Majesty's commands, diligently searched all his pockets, we observed a girdle about his waist made of the hide of some prodigious animal; from which, on the left side, hung a sword of the length of five men; and on the right, a bag or pouch divided into two cells, each cell capable of holding three of your Majesty's subjects. In one of these cells were several globes or balls of a most ponderous metal, about the bigness of our heads, and requiring a strong hand to lift them: the other cell contained a heap of certain black grains, but of no great bulk or weight, for we could hold above fifty of them in the palms of our hands. This is an exact inventory of what we found about the body of the Man-Mountain, who used us with great civility, and due respect to your Majesty's commission. Signed and sealed on the fourth day of the eighty-ninth moon of your Majesty's auspicious reign. {P_1|CH_2 ^paragraph 10} Clefren Frelock, Marsi Frelock. - - When this inventory was read over to the Emperor, he directed me, although in very gentle terms, to deliver up the several particulars. He first called for my scimitar, which I took out, scabbard and all. In the meantime he ordered three thousand of his choicest troops (who then attended him) to surround me at a distance, with their bows and arrows just ready to discharge: but I did not observe it, for my eyes were wholly fixed upon his Majesty. He then desired me to draw my scimitar, which, although it had got some rust by the sea water, was in most parts exceeding bright. I did so, and immediately all the troops gave a shout between terror and surprise; for the sun shone clear, and the reflection dazzled their eyes as I waved the scimitar to and fro in my hand. His Majesty, who is a most magnanimous prince, was less daunted than I could expect; he ordered me to return it into the scabbard, and cast it on the ground as gently as I could, about six foot from the end of my chain. The next thing he demanded was one of the hollow iron pillars, by which he meant my pocket-pistols. I drew it out, and at his desire, as well as I could, expressed to him the use of it; and charging it only with powder, which by the closeness of my pouch happened to escape wetting in the sea (an inconvenience against which all prudent mariners take special care to provide) I first cautioned the Emperor not to be afraid, and then I let it off in the air. The astonishment here was much greater than at the sight of my scimitar. Hundreds fell down as if they had been struck dead; and even the Emperor, although he stood his ground, could not recover himself in some time. I delivered up both my pistols in the same manner as I had done my scimitar, and then my pouch of powder and bullets; begging him that the former might be kept from the fire, for it would kindle with the smallest spark, and blow up his imperial palace into the air. I likewise delivered up my watch, which the Emperor was very curious to see, and commanded two of his tallest yeomen of the guards to bear it on a pole upon their shoulders, as draymen in England do a barrel of ale. He was amazed at the continual noise it made, and the motion of the minute-hand, which he could easily discern; for their sight is much more acute than ours; and asked the opinions of his learned men about him, which were various and remote, as the reader may well imagine without my repeating; although indeed I could not very perfectly understand them. I then gave up my silver and copper money, my purse with nine large pieces of gold, and some smaller ones; my knife and razor, my comb and silver snuff-box, my handkerchief and journal-book. My scimitar, pistols, and pouch, were conveyed in carriages to his Majesty's stores; but the rest of my goods were returned me. I had, as I before observed, one private pocket which escaped their search, wherein there was a pair of spectacles (which I sometimes use for the weakness of my eyes), a pocket perspective, and several other little conveniences; which, being of no consequence to the Emperor, I did not think myself bound in honor to discover, and I apprehended they might be lost or spoiled if I ventured them out of my possession. P_1|CH_3 CHAPTER III - My gentleness and good behavior had gained so far on the Emperor and his court, and indeed upon the army and people in general, that I began to conceive hopes of getting my liberty in a short time. I took all possible methods to cultivate this favorable disposition. The natives came by degrees to be less apprehensive of any danger from me. I would sometimes lie down, and let five or six of them dance on my hand. And last the boys and girls would venture to come and play at hide and seek in my hair. I had now made good progress in understanding and speaking their language. The Emperor had a mind one day to entertain me with several of the country shows, wherein they exceeded all nations I have known, both for dexterity and magnificence. I was diverted with none so much as that of the rope-dancers, performed upon a slender white thread, extended about two feet, and twelve inches from the ground. Upon which I shall desire liberty, with the reader's patience, to enlarge a little. This diversion is only practiced by those persons who are candidates for great employments and high favors at court. They are trained in this art from their youth, and are not always of noble birth, or liberal education. When a great office is vacant either by death or disgrace (which often happens) five or six of those candidates petition the Emperor to entertain his Majesty and the court with a dance on the rope, and whoever jumps the highest without falling, succeeds in the office. Very often the chief ministers themselves are commanded to show their skill, and to convince the Emperor that they have not lost their faculty. Flimnap, the Treasurer, is allowed to cut a caper on the straight rope, at least an inch higher than any other lord in the whole empire. I have seen him do the summerset several times together upon a trencher fixed on the rope, which is no thicker than a common packthread in England. My friend Reldresal, principal Secretary for Private Affairs, is, in my opinion, if I am not partial, the second after the Treasurer; the rest of the great officers are much upon a par. These diversions are often attended with fatal accidents, whereof great numbers are on record. I myself have seen two or three candidates break a limb. But the danger is much greater when the ministers themselves are commanded to show their dexterity; for by contending to excell themselves and their fellows, they strain so far, that there is hardly one of them who has not received a fall, and some of them two or three. I was assured that a year or two before my arrival, Flimnap would have infallibly broken his neck, if one of the King's cushions, that accidentally lay on the ground, had not weakened the force of his fall. There is likewise another diversion, which is only shown before the Emperor and Empress, and first minister, upon particular occasions. The Emperor lays on the table three fine silken threads of six inches long. One is blue, the other red, and the third green. These threads are proposed as prizes for those persons whom the Emperor has a mind to distinguish by a peculiar mark of his favor. The ceremony is performed in his Majesty's great chamber of state, where the candidates are to undergo a trial of dexterity very different from the former, and such as I have not observed the least resemblance of in any other country of the old or the new world. The Emperor holds a stick in his hands, both ends parallel to the horizon, while the candidates, advancing one by one, sometimes leap over the stick, sometimes creep under it backwards and forwards several times, according as the stick is advanced or depressed. Sometimes the Emperor holds one end of the stick, and his first minister the other; sometimes the minister has it entirely to himself. Whoever performs his part with most agility, and holds out the longest in leaping and creeping, is rewarded with the blue-colored silk; the red is given to the next, and the green to the third, which they all wear girt twice round about the middle; and you see few great persons about this court who are not adorned with one of these girdles. The horses of the army, and those of the royal stables, having been daily led before me, were no longer shy, but would come up to my very feet without starting. The riders would leap them over my hand as I held it on the ground, and one of the Emperor's huntsmen, upon a large courser, took my foot, shoe and all; which was indeed a prodigious leap. I had the good fortune to divert the Emperor one day after a very extraordinary manner. I desired he would order several sticks two feet high, and the thickness of an ordinary cane, to be brought me; whereupon his Majesty commanded the master of his woods to give directions accordingly; and the next morning six woodmen arrived with as many carriages, drawn by eight horses to each. I took nine of these sticks, and fixing them firmly in the ground in a quadrangular figure, two feet and a half square, I took four other sticks, and tied them parallel at each corner, about two feet from the ground; then I fastened my handkerchief to the nine sticks that stood erect, and extended it on all sides till it was as tight as the top of a drum; and the four parallel sticks rising about five inches higher than the handkerchief served as ledges on each side. When I had finished my work, I desired the Emperor to let a troop of his best horse, twentyfour in number, come and exercise upon this plain. His Majesty approved of the proposal, and I took them up one by one in my hands, ready mounted and armed, with the proper officers to exercise them. As soon as they got into order, they divided into two parties, performed mock skirmishes, discharged blunt arrows, drew their swords, fled and pursued, attacked and retired, and in short discovered the best military discipline I ever beheld. The parallel sticks secured them and their horses from falling over the stage; and the Emperor was so much delighted, that he ordered this entertainment to be repeated several days, and once was pleased to be lifted up and give the word of command; and, with great difficulty, persuaded even the Empress herself to let me hold her in her close chair within two yards of the stage, from whence she was able to take a full view of the whole performance. It was my good fortune that no ill accident happened in these entertainments, only once a fiery horse that belonged to one of the captains pawing with his hoof struck a hole in my handkerchief, and his foot slipping, he overthrew his rider and himself; but I immediately relieved them both, and covering the hole with one hand, I set down the troop with the other, in the same manner as I took them up. The horse that fell was strained in the left shoulder, but the rider got no hurt, and I repaired my handkerchief as well as I could: however I would not trust to the strength of it any more in such dangerous enterprises. {P_1|CH_3 ^paragraph 5} About two or three days before I was set at liberty, as I was entertaining the court with these kind of feats, there arrived an express to inform his Majesty that some of his subjects riding near the place where I was first taken up, had seen a great black substance lying on the ground, very oddly shaped, extending its edges round as wide as his Majesty's bedchamber, and rising up in the middle as high as a man; that it was no living creature, as they at first apprehended, for it lay on the grass without motion, and some of them had walked round it several tunes: that by mounting upon each other's shoulders, they had got to the top, which was flat and even, and stamping upon it they found it was hollow within; that they humbly conceived it might be something belonging to the Man-Mountain, and if his Majesty pleased, they would undertake to bring it with only five horses. I presently knew what they meant, and was glad at heart to receive this intelligence. It seems upon my first reaching the shore after our shipwreck, I was in such confusion, that before I came to the place where I went to sleep, my hat, which I had fastened with a string to my head while I was rowing, and had stuck on all the time I was swimming, fell off after I came to land; the string, as I conjecture, breaking by some accident which I never observed, but thought my hat had been lost at sea. I entreated his Imperial Majesty to give orders it might be brought to me as soon as possible, describing to him the use and the nature of it: and the next day the wagoners arrived with it, but not in a very good condition; they had bored two holes in the brim, within an inch and a half of the edge, and fastened two hooks in the holes; these hooks were tied by a long cord to the harness, and thus my hat was dragged along for above half an English mile: but the ground in that country being extremely smooth and level, it received less damage than I expected. Two days after this adventure, the Emperor having ordered that part of his army which quarters in and about his metropolis to be in a readiness, took a fancy of diverting himself in a very singular manner. He desired I would stand like a Colossus, with my legs as far asunder as I conveniently could. He then commanded his General (who was an old experienced leader, and a great patron of mine) to draw up the troops in close order, and march them under me, the foot by twentyfour in a breast, and the horse by sixteen, with drums beating, colors flying, and pikes advanced. This body consisted of three thousand foot, and a thousand horse. His Majesty gave orders, upon pain of death, that every soldier in his march should observe the strictest decency with regard to my person; which, however, could not prevent some of the younger officers from turning up their eyes as they passed under me. And, to confess the truth, my breeches were at that time in so ill a condition, that they afforded some opportunities for laughter and admiration. I had sent so many memorials and petitions for my liberty, that his Majesty at length mentioned the matter, first in the cabinet, and then in a full council; where it was opposed by none, except Skyresh Bolgolam, who was pleased, without any provocation, to be my mortal enemy. But it was carried against him by the whole board, and confirmed by the Emperor. That minister was Galbet, or Admiral of the Realm, very much in his master's confidence, and a person well versed in affairs, but of a morose and sour complexion. However, he was at length persuaded to comply; but prevailed that the articles and conditions upon which I should be set free, and to which I must swear, should be drawn up by himself. These articles were brought to me by Skyresh Bolgolam in person, attended by two under-secretaries, and several persons of distinction. After they were read, I was demanded to swear to the performance of them; first in the manner of my own country, and afterwards in the method prescribed by their laws; which was to hold my right foot in my left hand, to place the middle finger of my right hand on the crown of my head, and my thumb on the tip of my right ear. But because the reader may perhaps be curious to have some idea of the style and manner of expression peculiar to that people, as well as to know the articles upon which I recovered my liberty, I have made a translation of the whole instrument word for word, as near as I was able, which I here offer to the public. - GOLBASTO MOMAREN EVLAME GURDILO SHEFIN MULLY ULLY GUE, most mighty Emperor of Lilliput, delight and terror of the universe, whose dominions extend five thousand blustrugs (about twelve miles in circumference) to the extremities of the globe; monarch of all monarchs, taller than the sons of men; whose feet press down to the center, and whose head strikes against the sun; at whose nod the princes of the earth shake their knees; pleasant as the spring, comfortable as the summer, fruitful as autumn, dreadful as winter. His most sublime Majesty proposes to the Man-Mountain, lately arrived to our celestial dominions, the following articles, which by a solemn oath he shall be obliged to perform. {P_1|CH_3 ^paragraph 10} First, The Man-Mountain shall not depart from our dominions, without our license under our great seal. 2nd, He shall not presume to come into our metropolis, without our express order; at which time the inhabitants shall have two hours warning to keep within their doors. 3rd, The said Man-Mountain shall confine his walks to our principal high roads, and not offer to walk or lie down in a meadow or field of corn. 4th, As he walks the said roads, he shall take the utmost care not to trample upon the bodies of any of our loving subjects, their horses, or carriages, nor take any of our said subjects into his hands, without their own consent. 5th, If an express requires extraordinary dispatch, the Man-Mountain shall be obliged to carry in his pocket the messenger and horse a six days journey once in every moon, and return the said messenger back (if so required) safe to our Imperial Presence. {P_1|CH_3 ^paragraph 15} 6th, He shall be our ally against our enemies in the Island of Blefuscu, and do his utmost to destroy their fleet, which is now preparing to invade us. 7th, That the said Man-Mountain shall, at his times of leisure, be aiding and assisting to our workmen, in helping to raise certain great stones, towards covering the wall of the principal park, and other of our royal buildings. 8th, That the said Man-Mountain shall, in two moons' time, deliver in an exact survey of the circumference of our dominions by a computation of his own paces round the coast. Lastly, That upon his solemn oath to observe all the above articles, the said Man-Mountain shall have a daily allowance of meat and drink sufficient for the support of 1,728 of our subjects, with free access to our Royal Person, and other marks of our favor. Given at our Palace at Belfaborac the twelfth day of the ninety-first moon of our reign. - {P_1|CH_3 ^paragraph 20} I swore and subscribed to these articles with great cheerfulness and content, although some of them were not so honorable as I could have wished; which proceeded wholly from the malice of Skyresh Bolgolam the High Admiral: whereupon my chains were immediately unlocked, and I was at full liberty; the Emperor himself in person did me the honor to be by at the whole ceremony. I made my acknowledgments by prostrating myself at his Majesty's feet: but he commanded me to rise; and after many gracious expressions, which, to avoid the censure of vanity, I shall not repeat, he added, that he hoped I should prove a useful servant, and well deserve all the favors he had already conferred upon me, or might do for the future. The reader may please to observe, that in the last article for the recovery of my liberty the Emperor stipulates to allow me a quantity of meat and drink sufficient for the support of 1,728 Lilliputians. Some time after, asking a friend at court how they came to fix on that determinate number, he told me that his Majesty's mathematicians, having taken the height of my body by the help of a quadrant, and finding it to exceed theirs in the proportion of twelve to one, they concluded from the similarity of their bodies, that mine must contain at least 1,728 of theirs, and consequently would require as much food as was necessary to support that number of Lilliputians. By which the reader may conceive an idea of the ingenuity of that people, as well as the prudent and exact economy of so great a prince. P_1|CH_4 CHAPTER IV - The first request I made after I had obtained my liberty, was, that I might have license to see Mildendo, the metropolis, which the Emperor easily granted me, but with a special charge to do no hurt either to the inhabitants or their houses. The people had notice by proclamation of my design to visit the town. The wall which encompassed it is two feet and a half high, and at least eleven inches broad, so that a coach and horses may be driven very safely round it; and it is flanked with strong towers at ten feet distance. I stepped over the great Gate, and passed very gently, and sidering through the two principal streets, only in my short waistcoat, for fear of damaging the roofs and eaves of the houses with the skirts of my coat. I walked with the utmost circumspection, to avoid treading on any stragglers, that might remain in the streets, although the orders were very strict, that all people should keep in their houses at their own peril. The garret windows and tops of houses were so crowded with spectators, that I thought in all my travels I had not seen a more populous place. The city is an exact square, each side of the wall being five hundred feet long. The two great streets, which run cross and divide it into four quarters, are five feet wide. The lanes and alleys, which I could not enter, but only viewed them as I passed, are from twelve to eighteen inches. The town is capable of holding five hundred thousand souls. The houses are from three to five stories. The shops and markets well provided. The Emperor's palace is in the centre of the city, where the two great streets meet. It is enclosed by a wall of two feet high, and twenty feet distant from the buildings. I had his Majesty's permission to step over this wall; and the space being so wide between that and the palace, I could easily view it on every side. The outward court is a square of forty feet, and includes two other courts: in the inmost are the royal apartments, which I was very desirous to see, but found it extremely difficult; for the great gates, from one square into another, were but eighteen inches high and seven inches wide. Now the buildings of the outer court were at least five feet high, and it was impossible for me to stride over them without infinite damage to the pile, though the walls were strongly built of hewn stone, and four inches thick. At the same time the Emperor had a great desire that I should see the magnificence of his palace; but this I was not able to do till three days after, which I spent in cutting down with my knife some of the largest trees in the royal park, about a hundred yards distant from the city. Of these trees I made two stools, each about three feet high, and strong enough to bear my weight. The people having received notice a second time, I went again through the city to the palace, with my two stools in my hands. When I came to the side of the outer court, I stood upon one stool, and took the other in my hand: this I lifted over the roof, and gently set it down on the space between the first and second court, which was eight feet wide. I then stepped over the buildings very conveniently from one stool to the other, and drew up the first after me with a hooked stick. By this contrivance I got into the inmost court; and lying down upon my side, I applied my face to the windows of the middle stories, which were left open on purpose, and discovered the most splendid apartments that can be imagined. There I saw the Empress and the young Princes, in their several lodgings, with their chief attendants about them. Her Imperial Majesty was pleased to smile very graciously upon me, and gave me out of the window her hand to kiss. But I shall not anticipate the reader with farther descriptions of this kind, because I reserve them for a greater work, which is now almost ready for the press, containing a general description of this empire, from its first erection, through a long series of princes, with a particular account of their wars and politics, laws, learning, and religion: their plants and animals, their peculiar manners and customs, with other matters very curious and useful; my chief design at present being only to relate such events and transactions as happened to the public, or to myself, during a residence of about nine months in that empire. One morning, about a fortnight after I had obtained my liberty, Reldresal, principal Secretary (as they style him) of Private Affairs, came to my house attended only by one servant. He ordered his coach to wait at a distance, and desired I would give him an hour's audience; which I readily consented to, on account of his quality and personal merits, as well as the many good offices he had done me during my solicitations at court. I offered to lie down, that he might the more conveniently reach my ear; but he chose rather to let me hold him in my hand during our conversation. He began with compliments on my liberty; said he might pretend to some merit in it: but, however, added, that if it had not been for the present situation of things at court, perhaps I might not have obtained it so soon. For, said he, as flourishing a condition as we may appear to be in to foreigners, we labor under two mighty evils; a violent faction at home, and the danger of an invasion by a most potent enemy from abroad. As to the first, you are to understand, that for above seventy moons past there have been two struggling parties in this empire, under the names of Tramecksan and Slamecksan, from the high and low heels on their shoes, by which they distinguish themselves. It is alleged indeed, that the high heels are most agreeable to our ancient constitution: but however this be, his Majesty has determined to make use of only low heels in the administration of the government, and all offices in the gift of the Crown, as you cannot but observe; and particularly, that his Majesty's Imperial heels are lower at least by a drurr than any of his court; (drurr is a measure about the fourteenth part of an inch). The animosities between these two parties run so high, that they will neither eat nor drink, nor talk with each other. We compute the Tramecksan, or High-Heels, to exceed us in number; but the power is wholly on our side. We apprehend his Imperial Highness, the Heir to the Crown, to have some tendency towards the High-Heels; at least we can plainly discover one of his heels higher than the other, which gives him a hobble in his gait. Now, in the midst of these intestine disquiets, we are threatened with an invasion from the Island of Blefuscu, which is the other great empire of the universe, almost as large and powerful as this of his Majesty. For as to what we have heard you affirm, that there are other kingdoms and states in the world inhabited by human creatures as large as yourself, our philosophers are in much doubt, and would rather conjecture that you dropped from the moon, or one of the stars; because it is certain, that a hundred mortals of your bulk would, in a short time, destroy all the fruits and cattle of his Majesty's dominions. Besides, our histories of six thousand moons make no mention of any other regions, than the two great empires of Lilliput and Blefuscu. Which two mighty powers have, as I was going to tell you, been engaged in a most obstinate war for six and thirty moons past. It began upon the following occasion. It is allowed on all hands, that the primitive way of breaking eggs, before we eat them, was upon the larger end: but his present Majesty's grandfather, while he was a boy, going to eat an egg, and breaking it according to the ancient practice, happened to cut one of his fingers. Whereupon the Emperor his father published an edict, commanding all his subjects, upon great penalties, to break the smaller end of their eggs. The people so highly resented this law, that our histories tell us there have been six rebellions raised on that account; wherein one Emperor lost his life, and another his crown. These civil commotions were constantly fomented by the monarchs of Blefuscu; and when they were quelled, the exiles always fled for refuge to that empire. It is computed, that eleven thousand persons have, at several times, suffered death, rather than submit to break their eggs at the smaller end. Many hundred large volumes have been published upon this controversy: but the books of the Big-Endians have been long forbidden, and the whole party rendered incapable by law of holding employments. During the course of these troubles, the Emperors of Blefuscu did frequently expostulate by their ambassadors, accusing us of making a schism in religion, by offending against a fundamental doctrine of our great prophet Lustrog, in the fifty-fourth chapter of the Blundecral (which is their however, is thought to be a mere strain upon the text: for the words are these; That all true believers shall break their eggs at the convenient end: and which is the convenient end, seems, in my humble opinion, to be left to every man's conscience, or at least in the power of the chief magistrate to determine. Now the Big-Endian exiles have found so much credit in the Emperor of Blefuscu's court, and so much private assistance and encouragement from their party here at home, that a bloody war has been carried on between the two empires for six and thirty moons with various success; during which time we have lost forty capital ships, and a much greater number of smaller vessels, together with thirty thousand of our best seamen and soldiers; and the damage received by the enemy is reckoned to be somewhat greater than ours. However, they have now equipped a numerous fleet, and are just preparing to make a descent upon us; and his Imperial Majesty, placing great confidence in your valor and strength, has commanded me to lay this account of his affairs before you. I desired the Secretary to present my humble duty to the Emperor, and to let him know, that I thought it would not become me, who was a foreigner, to interfere with parties; but I was ready, with the hazard of my life, to defend his person and state against all invaders. P_1|CH_5 CHAPTER V - The Empire of Blefuscu is an island situated to the north-northeast side of Lilliput, from whence it is parted only by a channel of eight hundred yards wide. I had not yet seen it, and upon this notice of an intended invasion, I avoided appearing on that side of the coast, for fear of being discovered by some of the enemy's ships, who had received no intelligence of me, all intercourse between the two empires having been strictly forbidden during the war, upon pain of death, and an embargo laid by our Emperor upon all vessels whatsoever. I communicated to his Majesty a project I had formed of seizing the enemy's whole fleet: which, as our scouts assured us, lay at anchor in the harbor ready to sail with the first fair wind. I consulted the most experienced seamen, upon the depth of the channel, which they had often plumbed, who told me, that in the middle at high-water it was seventy glumgluffs deep, which is about six feet of European measure; and the rest of it fifty glumgluffs at most. I walked towards the northeast coast over against Blefuscu; and lying down behind a hillock, took out my small pocket perspective glass, and viewed the enemy's fleet at anchor, consisting of about fifty men of war, and a great number of transports; I then came back to my house, and gave order (for which I had a warrant) for a great quantity of the strongest cable and bars of iron. The cable was about as thick as packthread, and the bars of the length and size of a knitting needle. I trebled the cable to make it stronger, and for the same reason I twisted three of the iron bars together, binding the extremities into a hook. Having thus fixed fifty hooks to as many cables, I went back to the northeast coast, and putting off my coat, shoes, and stockings, walked into the sea in my leather jerkin, about half an hour before high water. I waded with what haste I could, and swam in the middle about thirty yards till I felt ground; I arrived at the fleet in less than half an hour. The enemy was so frighted when they saw me, that they leaped out of their ships, and swam to shore, where there could not be fewer than thirty thousand souls. I then took my tackling, and fastening a hook to a hole at the prow of each, I tied all the cords together at the end. While I was thus employed, the enemy discharged several thousand arrows, many of which stuck in my hands and face; and besides the excessive smart, gave me much disturbance in my work. My greatest apprehension was for my eyes, which I should have infallibly lost, if I had not suddenly thought of an expedient. I kept among other little necessaries a pair of spectacles in a private pocket, which, as I observed before, had escaped the Emperor's searchers. These I took out and fastened as strongly as I could upon my nose, and thus armed went on boldly with my work in spite of the enemy's arrows, many of which struck against the glasses of my spectacles, but without any other effect, further than a little to discompose them. I now fastened all the hooks, and taking the knot in my hand, began to pull; but not a ship would stir, for they were all too fast held by their anchors, so that the boldest part of my enterprise remained. I therefore let go the cord, and leaving the hooks fixed to the ships, I resolutely cut with my knife the cables that fastened the anchors, receiving above two hundred shots in my face and hands; then I took up the knotted end of the cables to which my hooks were tied, and with great ease drew fifty of the enemy's men-of-war after me. The Blefuscudians, who had not the least imagination of what I intended, were at first confounded with astonishment. They had seen me cut the cables, and thought my design was only to let the ships run adrift or fall foul on each other: but when they perceived the whole fleet moving in order, and saw me pulling at the end, they set up such a scream of grief and despair, that it is almost impossible to describe or conceive. When I had got out of danger, I stopped awhile to pick out the arrows that stuck in my hands and face, and rubbed on some of the same ointment that was given me at my first arrival, as I have formerly mentioned. I then took off my spectacles, and waiting about an hour, till the tide was a little fallen, I waded through the middle with my cargo, and arrived safe at the royal port of Lilliput The Emperor and his whole court stood on the shore expecting the issue of this great adventure. They saw the ships move forward in a large half-moon, but could not discern me, who was up to my breast in water. When I advanced to the middle of the channel, they were yet in more pain, because I was under water to my neck. The Emperor concluded me to be drowned, and that the enemy's fleet was approaching in a hostile manner: but he was soon eased of his fears, for the channel growing shallower every step I made, I came in a short time within hearing, and holding up the end of the cable by which the fleet was fastened, I cried in a loud voice, Long live the most puissant Emperor of Lilliput! This great prince received me at my landing with all possible encomiums, and created me a Nardac upon the spot, which is the highest title of honor among them. His Majesty desired I would take some other opportunity of bringing all the rest of his enemy's ships into his ports. And so unmeasurable is the ambition of princes, that he seemed to think of nothing less than reducing the whole empire of Blefuscu into a province, and governing it by a Viceroy; of destroying the Big-Endian exiles, and compelling that people to break the smaller end of their eggs, by which he would remain the sole monarch of the whole world. But I endeavored to divert him from this design, by many arguments drawn from the topics of policy as well as justice; and I plainly protested, that I would never be an instrument of bringing a free and brave people into slavery. And when the matter was debated in council, the wisest part of the ministry were of my opinion. This open bold declaration of mine was so opposite to the schemes and politics of his Imperial Majesty, that he could never forgive it; he mentioned it in a very artful manner at council, where I was told that some of the wisest appeared, at least by their silence, to be of my opinion; but others, who were my secret enemies, could not forbear some expressions, which by a side-wind reflected on me. And from this time began an intrigue between his Majesty and a junto of ministers maliciously bent against me, which broke out in less than two months, and had like to have ended in my utter destruction. Of so little weight are the greatest services to princes, when put into the balance with a refusal to gratify their passions. {P_1|CH_5 ^paragraph 5} About three weeks after this exploit, there arrived a solemn embassy from Blefuscu, with humble offers of a peace; which was soon concluded upon conditions very advantageous to our Emperor, wherewith I shall not trouble the reader. There were six ambassadors, with a train of about five hundred persons, and their entry was very magnificent, suitable to the grandeur of their master, and the importance of their business. When their treaty was finished, wherein I did them several good offices by the credit I now had, or at least appeared to have at court, their Excellencies, who were privately told how much I had been their friend, made me a visit in form. They began with many compliments upon my valor and generosity, invited me to that kingdom in the Emperor their master's name, and desired me to show them some proofs of my prodigious strength, of which they had heard so many wonders; wherein I readily obliged them, but shall not trouble the reader with the particulars. When I had for some time entertained their Excellencies, to their infinite satisfaction and surprise, I desired they would do me the honor to present my most humble respects to the Emperor their master, the renown of whose had so justly filled the whole world with admiration, and whose royal person I resolved to attend before I returned to my own country: accordingly, the next time I had the honor to see our Emperor, I desired his general license to wait on the Blefuscudian monarch, which he was pleased to grant me, as I could plainly perceive, in a very cold manner; but could not guess the reason, till I had a whisper from a certain person, that Flimnap and Bolgolam had represented my intercourse with those ambassadors as a mark of disaffection, from which I am sure my heart was wholly free. And this was the first time I began to conceive some imperfect idea of courts and ministers. It is to be observed, that these ambassadors spoke to me by an interpreter, the languages of both empires differing as much from each other as any two in Europe, and each nation priding itself upon the antiquity, beauty, and energy of their own tongues, with an avowed contempt for that of their neighbor; yet our Emperor, standing upon the advantage he had got by the seizure of their fleet, obliged them to deliver their credentials, and make their speech in the Lilliputian tongue. And it must be confessed, that from the great intercourse of trade and commerce between both realms, from the continual reception of exiles, which is mutual among them, and from the custom in each empire to send their young nobility and richer gentry to the other, in order to polish themselves by seeing the world and understanding men and manners; there are few persons of distinction, or merchants, or seamen, who dwell in the maritime parts, but what can hold conversation both tongues; as I found some weeks after, when I went to pay my respects to the Emperor of Blefuscu, which in the midst of great misfortunes, through the malice of my enemies, proved a very happy adventure to me, as I shall relate in its proper place. The reader may remember, that when I signed those articles upon which I recovered my liberty, there were some which I disliked upon account of their being too servile, neither could anything but an extreme necessity have forced me to submit. But being now a Nardac, of the highest rank in that empire, such offices were looked upon as below my dignity, and the Emperor (to do him justice) never once mentioned them to me. However, it was not long before I had an opportunity of doing his Majesty, at least, as I then thought, a most signal service. I was alarmed at midnight with the cries of many hundred people at my door; by which being suddenly awaked, I was in some kind of terror. I heard the word burglum repeated incessantly: several of the Emperor's court, making their way through the crowd, entreated me to come immediately to the Palace, where her Imperial Majesty's apartment was on fire, by the carelessness of a maid of honor, who fell asleep while she was reading a romance. I got up in an instant; and orders being given to clear the way before me, and it being likewise a moonshine night, I made a shift to get to the Palace without trampling on any of the people. I found they had already applied ladders to the walls of the apartment, and were well provided with buckets, but the water was at some distance. These buckets were about the size of a large thimble, and the poor people supplied me with them as fast as they could; but the flame was so violent that they did little good. I might easily have stifled it with my coat, which I unfortunately left behind me for haste, and came away only in my leathern jerkin. The case seemed wholly desperate and deplorable; and this magnificent palace would have infallibly been burned down to the ground, if, by a presence of mind, unusual to me, I had not suddenly thought of an expedient. I had the evening before drunk plentifully of a most delicious wine, called glimigrim (the Blefuscudians call it flunec, but ours is esteemed the better sort), which is very diuretic. By the luckiest chance in the world, I had not discharged myself of any part of it. The heat I had contracted by coming very near the flames, and by laboring to quench them, made the wine begin to operate my urine; which I voided in such a quantity, and applied so well to the proper places, that in three minutes the fire was wholly extinguished, and the rest of that noble pile, which had cost so many ages in erecting, preserved from destruction. It was now daylight, and I returned to my house without waiting to congratulate with the Emperor: because, although I had done a very eminent piece of service, yet I could not tell how his Majesty might resent the manner by which I had performed it: for, by the fundamental laws of the realm, it is capital in any person, of what quality soever, to make water within the precincts of the palace. But I was a little comforted by a message from his Majesty, that he would give orders to the Grand Justiciary for passing my pardon in form; which, however, I could not obtain. And I was privately assured, that the Empress, conceiving the greatest abhorrence of what I had done, removed to the most distant side of the court, firmly resolved that those buildings should never be repaired for her use: and, in the presence of her chief confidants could not forbear vowing revenge. P_1|CH_6 CHAPTER VI - Although I intend to leave the description of this empire to a particular treatise, yet in the meantime I am content to gratify the curious reader with some general ideas. As the common size of the natives is somewhat under six inches high, so there is an exact proportion in all other animals, as well as plants and trees: for instance, the tallest horses and oxen are between four and five inches in height, the sheep an inch and a half, more or less: their geese about the bigness of a sparrow, and so the several gradations downwards till you come to the smallest, which, to my sight, were almost invisible; but nature had adapted the eyes of the Lilliputians to all objects proper for their view: they see with great exactness, but at no great distance. And to show the sharpness of their sight towards objects that are near, I have been much pleased with observing a cook pulling a lark, which was not so large as a common fly; and a young girl threading an invisible needle with invisible silk. Their tallest trees are about seven feet high; I mean some of those in the great royal park, the tops whereof I could but just reach with my fist clenched. The other vegetables are in the same proportion; but this I leave to the reader's imagination. I shall say but little at present of their learning, which for many ages had flourished in all its branches among them; but their manner of writing is very peculiar, being neither from the left to the right, like the Europeans; nor from the right to the left, like the Arabians; nor from up to down, like the Chinese; nor from down to up, like the Cascagians; but aslant from one corner of the paper to the other, like ladies in England. They bury their dead with their heads directly downwards, because they hold an opinion, that in eleven thousand moons they are all to rise again, in which period the earth (which they conceive to be flat) will turn upside down, and by this means they shall, at their resurrection, be found ready standing on their feet. The learned among them confess the absurdity of this doctrine, but the practice still continues, in compliance to the vulgar. There are some laws and customs in this empire very peculiar; and if they were not so directly contrary to those of my own dear country, I should be tempted to say a little in their justification. It is only to be wished that they were as well executed. The first I shall mention relates to informers. All crimes against the state are punished here with the utmost severity; but if the person accused makes his innocence plainly to appear upon his trial, the accuser is immediately put to an ignominious death; and out of his goods or lands, the innocent person is quadruply recompensed for the loss of his time, for the danger he underwent, for the hardship of his imprisonment, and for all the charges he had been at in making his defense. Or, if that fund be deficient, it is largely supplied by the Crown. The Emperor does also confer on him some public mark of his favor, and proclamation is made of his innocence through the whole city. They look upon fraud as a greater crime than theft, and therefore seldom fail to punish it with death; for they allege, that care and vigilance, with a very common understanding, may preserve a man's goods from thieves, but honesty has no fence against superior cunning; and since it is necessary that there should be a perpetual intercourse of buying and selling, and dealing upon credit, where fraud is permitted and connived at, or has no law to punish it, the honest dealer is always undone, and the knave gets the advantage. remember when I was once interceding with the King for a criminal who had wronged his master of a great sum of money, which he had received by order, and ran away with; and happening to tell his Majesty, by way of extenuation, that it was only a breach of trust; the Emperor thought it monstrous in me to offer, as a defense, the greatest aggravation of the crime: and truly I had little to say in return, farther than the common answer, that different nations had different customs; for, I confess, I was heartily ashamed. {P_1|CH_6 ^paragraph 5} Although we usually call reward and punishment the two hinges upon which all government turns, yet I could never observe this maxim to be put in practice by any nation except that of Lilliput. Whoever can there bring sufficient proof that he has strictly observed the laws of his country for seventy-three moons, has a claim to certain privileges, according to his quality and condition of life, with a proportionable sum of money out of a fund appropriated for that use: he likewise acquires the title of Snilpall, or Legal, which is added to his name, but does not descend to his posterity. And these people thought it a prodigious defect of policy among us, when I told them that our laws were enforced only by penalties without any mention of reward. It is upon this account that the image of justice, in their courts of judicature, is formed with six eyes, two before, as many behind, and on each side one, to signify circumspection; with a bag of gold open in her right hand, and a sword sheathed in her left, to show she is more disposed to reward than to punish. In choosing persons for all employments, they have more regard to good morals than to great abilities; for, since government is necessary to mankind, they believe-that the common size of human understandings is fitted to some station or other, and that Providence never intended to make the management of public affairs a mystery, to be comprehended only by a few persons of sublime genius, of which there seldom are three born in an age: but they suppose truth, justice, temperance, and the like, to be in every man's power; the practice of which virtues, assisted by experience and a good intention, would qualify any man for the service of his country, except where a course of study is required. But they thought the want of moral virtues was so far from being supplied by superior endowments of the mind, that employments could never be put into such dangerous hands as those of persons so qualified; and at least, that the mistakes committed by ignorance in a virtuous disposition, would never be of such fatal consequence to the public weal, as the practices of a man whose inclinations led him to be corrupt, and had great abilities to manage, and multiply, and defend his corruptions. In like manner, the disbelief of a Divine Providence renders a man incapable of holding any public station; for, since kings avow themselves to be the deputies of Providence, the Lilliputians think nothing can be more absurd than for a prince to employ such men as disown the authority under which he acts. In relating these and the following laws, I would only be understood to mean the original institutions, and not the most scandalous corruptions into which these people are fallen by the degenerate nature of man. For as to that infamous practice of acquiring great employments by dancing on the ropes, or badges of favor and distinction by leaping over sticks and creeping under them, the reader is to observe, that they were first introduced by the grandfather of the Emperor now reigning, and grew to the present height by the gradual increase of party and faction. Ingratitude is among them a capital crime, as we read it to have been in some other countries; for they reason thus, that whoever makes ill returns to his benefactor, must needs be a common enemy to the rest of mankind, from whom he has received no obligation, and therefore such a man is not fit to live. {P_1|CH_6 ^paragraph 10} Their notions relating to the duties of parents and children differ extremely from ours. For since the conjunction of male and female is founded upon the great law of nature, in order to propagate and continue the species, the Lilliputians will needs have it, that men and women are joined together like other animals, by the motives of concupiscence; and that their tenderness towards their young proceeds from the like natural principle: for which reason they will never allow, that a child is under any obligation to his father for begetting him, or his mother for bringing him into the world; which, considering the miseries of human life, was neither a benefit itself, nor intended so by his parents, whose thoughts in their love-encounters were otherwise employed. Upon these, and the like reasonings, their opinion is, that parents are the last of all others to be trusted with the education of their own children: and therefore they have in every town public nurseries, where all parents, except cottagers and laborers, are obliged to send their infants of both sexes to be reared and educated when they come to the age of twenty moons, at which time they are supposed to have some rudiments of docility. These schools are of several kinds, suited to different qualities, and to both sexes. They have certain professors well skilled in preparing children for such a condition of life as befits the rank of their parents, and their own capacities as well as inclinations. I shall say something of the male nurseries, and then of the female. The nurseries for males of noble or eminent birth are provided with grave and learned professors, and their several deputies. The clothes and food of the children are plain and simple. They are bred up in the principles of honor, justice, courage, modesty, clemency, religion, and love of their country; they are always employed in some business, except in the times of eating and sleeping, which are very short, and two hours for diversions, consisting of bodily exercises. They are dressed by men till four years of age, and then are obliged to dress themselves, although their quality be ever so great; and the women attendants, who are aged proportionably to ours at fifty, perform only the most menial offices. They are never suffered to converse with servants, but go together in small or greater numbers to take their diversions, and always in the presence of a professor, or one of his deputies; whereby they avoid those early bad impressions of folly and vice to which our children are subject. Their parents are suffered to see them only twice a year; the visit is to last but an hour. They are allowed to kiss the child at meeting and parting; but a professor, who always stands by on those occasions, will not suffer them to whisper, or use any fondling expressions, or bring any presents of toys, sweetmeats, and the like. The pension from each family for the education and entertainment of a child, upon failure of due payment, is levied by the Emperor's officers. The nurseries for children of ordinary gentlemen, merchants, traders, and handicrafts, are managed proportionably after the same manner; only those designed for trades are put out apprentices at eleven years old, whereas those of persons of quality continue in their exercises till fifteen, which answers to one and twenty with us: but the confinement is gradually lessened for the last three years. In the female nurseries, the young girls of quality are educated much like the males, only they are dressed by orderl
Download .txt
gitextract_4puswicl/

├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       └── node.js.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── SECURITY.md
├── demo/
│   ├── autocomplete.html
│   └── data/
│       ├── gulliver.js
│       └── movies.js
├── dist/
│   ├── db/
│   │   ├── clickhouse/
│   │   │   └── index.cjs
│   │   ├── indexeddb/
│   │   │   └── index.cjs
│   │   ├── mongodb/
│   │   │   └── index.cjs
│   │   ├── postgres/
│   │   │   └── index.cjs
│   │   ├── redis/
│   │   │   └── index.cjs
│   │   └── sqlite/
│   │       └── index.cjs
│   ├── flexsearch.bundle.debug.js
│   ├── flexsearch.bundle.module.debug.js
│   ├── flexsearch.bundle.module.debug.mjs
│   ├── flexsearch.bundle.module.min.mjs
│   ├── flexsearch.compact.debug.js
│   ├── flexsearch.compact.module.debug.js
│   ├── flexsearch.es5.debug.js
│   ├── flexsearch.light.debug.js
│   ├── flexsearch.light.module.debug.js
│   ├── module/
│   │   ├── async.js
│   │   ├── bundle.js
│   │   ├── cache.js
│   │   ├── charset/
│   │   │   ├── cjk.js
│   │   │   ├── exact.js
│   │   │   ├── latin/
│   │   │   │   ├── advanced.js
│   │   │   │   ├── balance.js
│   │   │   │   ├── extra.js
│   │   │   │   └── soundex.js
│   │   │   ├── normalize.js
│   │   │   └── polyfill.js
│   │   ├── charset.js
│   │   ├── common.js
│   │   ├── compress.js
│   │   ├── db/
│   │   │   ├── clickhouse/
│   │   │   │   └── index.js
│   │   │   ├── indexeddb/
│   │   │   │   └── index.js
│   │   │   ├── interface.js
│   │   │   ├── mongodb/
│   │   │   │   └── index.js
│   │   │   ├── postgres/
│   │   │   │   └── index.js
│   │   │   ├── redis/
│   │   │   │   └── index.js
│   │   │   └── sqlite/
│   │   │       └── index.js
│   │   ├── document/
│   │   │   ├── add.js
│   │   │   ├── highlight.js
│   │   │   └── search.js
│   │   ├── document.js
│   │   ├── encoder.js
│   │   ├── index/
│   │   │   ├── add.js
│   │   │   ├── remove.js
│   │   │   └── search.js
│   │   ├── index.js
│   │   ├── intersect.js
│   │   ├── keystore.js
│   │   ├── lang/
│   │   │   ├── de.js
│   │   │   ├── en.js
│   │   │   └── fr.js
│   │   ├── preset.js
│   │   ├── profiler.js
│   │   ├── resolve/
│   │   │   ├── and.js
│   │   │   ├── default.js
│   │   │   ├── handler.js
│   │   │   ├── not.js
│   │   │   ├── or.js
│   │   │   └── xor.js
│   │   ├── resolver.js
│   │   ├── serialize.js
│   │   ├── type.js
│   │   ├── worker/
│   │   │   ├── handler.js
│   │   │   ├── node.js
│   │   │   └── worker.js
│   │   └── worker.js
│   ├── module-debug/
│   │   ├── async.js
│   │   ├── bundle.js
│   │   ├── cache.js
│   │   ├── charset/
│   │   │   ├── cjk.js
│   │   │   ├── exact.js
│   │   │   ├── latin/
│   │   │   │   ├── advanced.js
│   │   │   │   ├── balance.js
│   │   │   │   ├── extra.js
│   │   │   │   └── soundex.js
│   │   │   ├── normalize.js
│   │   │   └── polyfill.js
│   │   ├── charset.js
│   │   ├── common.js
│   │   ├── compress.js
│   │   ├── db/
│   │   │   ├── clickhouse/
│   │   │   │   └── index.js
│   │   │   ├── indexeddb/
│   │   │   │   └── index.js
│   │   │   ├── interface.js
│   │   │   ├── mongodb/
│   │   │   │   └── index.js
│   │   │   ├── postgres/
│   │   │   │   └── index.js
│   │   │   ├── redis/
│   │   │   │   └── index.js
│   │   │   └── sqlite/
│   │   │       └── index.js
│   │   ├── document/
│   │   │   ├── add.js
│   │   │   ├── highlight.js
│   │   │   └── search.js
│   │   ├── document.js
│   │   ├── encoder.js
│   │   ├── index/
│   │   │   ├── add.js
│   │   │   ├── remove.js
│   │   │   └── search.js
│   │   ├── index.js
│   │   ├── intersect.js
│   │   ├── keystore.js
│   │   ├── lang/
│   │   │   ├── de.js
│   │   │   ├── en.js
│   │   │   └── fr.js
│   │   ├── preset.js
│   │   ├── profiler.js
│   │   ├── resolve/
│   │   │   ├── and.js
│   │   │   ├── default.js
│   │   │   ├── handler.js
│   │   │   ├── not.js
│   │   │   ├── or.js
│   │   │   └── xor.js
│   │   ├── resolver.js
│   │   ├── serialize.js
│   │   ├── type.js
│   │   ├── worker/
│   │   │   ├── handler.js
│   │   │   ├── node.js
│   │   │   └── worker.js
│   │   └── worker.js
│   └── module-min/
│       ├── async.js
│       ├── bundle.js
│       ├── cache.js
│       ├── charset/
│       │   ├── cjk.js
│       │   ├── exact.js
│       │   ├── latin/
│       │   │   ├── advanced.js
│       │   │   ├── balance.js
│       │   │   ├── extra.js
│       │   │   └── soundex.js
│       │   ├── normalize.js
│       │   └── polyfill.js
│       ├── charset.js
│       ├── common.js
│       ├── compress.js
│       ├── db/
│       │   ├── clickhouse/
│       │   │   └── index.js
│       │   ├── indexeddb/
│       │   │   └── index.js
│       │   ├── interface.js
│       │   ├── mongodb/
│       │   │   └── index.js
│       │   ├── postgres/
│       │   │   └── index.js
│       │   ├── redis/
│       │   │   └── index.js
│       │   └── sqlite/
│       │       └── index.js
│       ├── document/
│       │   ├── add.js
│       │   ├── highlight.js
│       │   └── search.js
│       ├── document.js
│       ├── encoder.js
│       ├── index/
│       │   ├── add.js
│       │   ├── remove.js
│       │   └── search.js
│       ├── index.js
│       ├── intersect.js
│       ├── keystore.js
│       ├── lang/
│       │   ├── de.js
│       │   ├── en.js
│       │   └── fr.js
│       ├── preset.js
│       ├── profiler.js
│       ├── resolve/
│       │   ├── and.js
│       │   ├── default.js
│       │   ├── handler.js
│       │   ├── not.js
│       │   ├── or.js
│       │   └── xor.js
│       ├── resolver.js
│       ├── serialize.js
│       ├── type.js
│       ├── worker/
│       │   ├── handler.js
│       │   ├── node.js
│       │   └── worker.js
│       └── worker.js
├── doc/
│   ├── async.md
│   ├── custom-builds.md
│   ├── customization.md
│   ├── document-search.md
│   ├── encoder.md
│   ├── export-import.md
│   ├── keystore.md
│   ├── persistent-clickhouse.md
│   ├── persistent-indexeddb.md
│   ├── persistent-mongodb.md
│   ├── persistent-postgres.md
│   ├── persistent-redis.md
│   ├── persistent-sqlite.md
│   ├── persistent.md
│   ├── resolver.md
│   ├── result-highlighting.md
│   └── worker.md
├── docker-compose.yml
├── example/
│   ├── browser-legacy/
│   │   ├── basic/
│   │   │   └── index.html
│   │   ├── basic-persistent/
│   │   │   └── index.html
│   │   ├── basic-resolver/
│   │   │   └── index.html
│   │   ├── basic-suggestion/
│   │   │   └── index.html
│   │   ├── basic-worker/
│   │   │   └── index.html
│   │   ├── document/
│   │   │   └── index.html
│   │   ├── document-highlighting/
│   │   │   └── index.html
│   │   ├── document-persistent/
│   │   │   └── index.html
│   │   ├── document-resolver/
│   │   │   └── index.html
│   │   ├── document-worker/
│   │   │   └── index.html
│   │   └── language-pack/
│   │       └── index.html
│   ├── browser-module/
│   │   ├── basic/
│   │   │   └── index.html
│   │   ├── basic-persistent/
│   │   │   └── index.html
│   │   ├── basic-resolver/
│   │   │   └── index.html
│   │   ├── basic-suggestion/
│   │   │   └── index.html
│   │   ├── basic-worker/
│   │   │   └── index.html
│   │   ├── basic-worker-extern-config/
│   │   │   ├── config.js
│   │   │   └── index.html
│   │   ├── document/
│   │   │   └── index.html
│   │   ├── document-highlighting/
│   │   │   └── index.html
│   │   ├── document-persistent/
│   │   │   └── index.html
│   │   ├── document-resolver/
│   │   │   └── index.html
│   │   ├── document-worker/
│   │   │   └── index.html
│   │   ├── document-worker-extern-config/
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   └── index.html
│   │   └── language-pack/
│   │       └── index.html
│   ├── nodejs-commonjs/
│   │   ├── .document-worker-persistent/
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-export-import/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-persistent/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-resolver/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-suggestion/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker-export-import/
│   │   │   ├── config.js
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── basic-worker-extern-config/
│   │   │   ├── config.js
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-export-import/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-persistent/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-resolver/
│   │   │   ├── README.md
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker/
│   │   │   ├── README.md
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker-export-import/
│   │   │   ├── README.md
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── document-worker-extern-config/
│   │   │   ├── README.md
│   │   │   ├── config.originalTitle.js
│   │   │   ├── config.primaryTitle.js
│   │   │   ├── data.json
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   └── language-pack/
│   │       ├── README.md
│   │       ├── index.js
│   │       └── package.json
│   └── nodejs-esm/
│       ├── basic/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-export-import/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-persistent/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-resolver/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-suggestion/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker-export-import/
│       │   ├── config.js
│       │   ├── index.js
│       │   └── package.json
│       ├── basic-worker-extern-config/
│       │   ├── README.md
│       │   ├── config.js
│       │   ├── index.js
│       │   └── package.json
│       ├── document/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-export-import/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-persistent/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-resolver/
│       │   ├── README.md
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker/
│       │   ├── README.md
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker-export-import/
│       │   ├── README.md
│       │   ├── config.originalTitle.js
│       │   ├── config.primaryTitle.js
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       ├── document-worker-extern-config/
│       │   ├── README.md
│       │   ├── config.originalTitle.js
│       │   ├── config.primaryTitle.js
│       │   ├── data.json
│       │   ├── index.js
│       │   └── package.json
│       └── language-pack/
│           ├── README.md
│           ├── index.js
│           └── package.json
├── index.d.ts
├── package.json
├── src/
│   ├── async.js
│   ├── bundle.js
│   ├── cache.js
│   ├── charset/
│   │   ├── cjk.js
│   │   ├── exact.js
│   │   ├── latin/
│   │   │   ├── advanced.js
│   │   │   ├── balance.js
│   │   │   ├── extra.js
│   │   │   └── soundex.js
│   │   ├── normalize.js
│   │   └── polyfill.js
│   ├── charset.js
│   ├── common.js
│   ├── compress.js
│   ├── config.js
│   ├── db/
│   │   ├── clickhouse/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── indexeddb/
│   │   │   └── index.js
│   │   ├── interface.js
│   │   ├── mongodb/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── postgres/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   ├── redis/
│   │   │   ├── index.js
│   │   │   └── package.json
│   │   └── sqlite/
│   │       ├── index.js
│   │       └── package.json
│   ├── document/
│   │   ├── add.js
│   │   ├── highlight.js
│   │   └── search.js
│   ├── document.js
│   ├── encoder.js
│   ├── index/
│   │   ├── add.js
│   │   ├── remove.js
│   │   └── search.js
│   ├── index.js
│   ├── intersect.js
│   ├── keystore.js
│   ├── lang/
│   │   ├── de.js
│   │   ├── en.js
│   │   └── fr.js
│   ├── preset.js
│   ├── profiler.js
│   ├── resolve/
│   │   ├── and.js
│   │   ├── default.js
│   │   ├── handler.js
│   │   ├── not.js
│   │   ├── or.js
│   │   └── xor.js
│   ├── resolver.js
│   ├── serialize.js
│   ├── type.js
│   ├── worker/
│   │   ├── handler.js
│   │   ├── node.js
│   │   ├── node.mjs
│   │   └── worker.js
│   └── worker.js
├── task/
│   ├── babel.bundle.json
│   ├── babel.debug.json
│   ├── babel.js
│   ├── babel.min.json
│   └── build.js
└── test/
    ├── .c8rc.json
    ├── async.js
    ├── basic.js
    ├── cache.js
    ├── context.js
    ├── debug.js
    ├── document.js
    ├── document.tag.js
    ├── encoder.js
    ├── highlight.js
    ├── issues.js
    ├── keystore.js
    ├── misc/
    │   ├── reporter.js
    │   └── runner.js
    ├── package.json
    ├── persistent.clickhouse.js
    ├── persistent.js
    ├── persistent.mongo.js
    ├── persistent.postgres.js
    ├── persistent.redis.js
    ├── persistent.sqlite.js
    ├── resolver.js
    ├── scoring.js
    ├── serialize.js
    ├── tokenize.js
    ├── types.ts
    └── worker.js
Download .txt
SYMBOL INDEX (1035 symbols across 160 files)

FILE: dist/db/clickhouse/index.cjs
  function concat (line 12) | function concat(arrays){
  function toArray (line 22) | function toArray(val, stringify){
  function sanitize (line 70) | function sanitize(str) {
  function ClickhouseDB (line 81) | function ClickhouseDB(name, config = {}){
  function create_result (line 226) | function create_result(rows, resolve, enrich){

FILE: dist/db/indexeddb/index.cjs
  function create_object (line 10) | function create_object(){
  constant VERSION (line 14) | const VERSION = 1;
  function sanitize (line 27) | function sanitize(str) {
  function IdxDB (line 40) | function IdxDB(name, config = {}){
  function handle (line 561) | function handle(cursor, ids, _tag){
  function promisfy (line 666) | function promisfy(req, callback){

FILE: dist/db/mongodb/index.cjs
  function sanitize (line 13) | function sanitize(str) {
  constant CLIENT (line 17) | let CLIENT;
  function MongoDB (line 25) | function MongoDB(name, config = {}){
  function createCollection (line 55) | async function createCollection(db, ref, field){
  function clear (line 138) | async function clear(ref){
  function create_result (line 153) | function create_result(rows, resolve, enrich){

FILE: dist/db/postgres/index.cjs
  function concat (line 12) | function concat(arrays){
  constant MAXIMUM_QUERY_VARS (line 26) | const MAXIMUM_QUERY_VARS = 16000;
  function sanitize (line 50) | function sanitize(str) {
  function PostgresDB (line 61) | function PostgresDB(name, config = {}){
  function create_result (line 218) | function create_result(rows, resolve, enrich){

FILE: dist/db/redis/index.cjs
  function toArray (line 18) | function toArray(val, stringify){
  constant TRX (line 32) | let DB, TRX;
  function sanitize (line 34) | function sanitize(str) {
  function RedisDB (line 42) | function RedisDB(name, config = {}){
  function unlink (line 111) | function unlink(keys){
  function create_result (line 127) | function create_result(range, type, resolve, enrich, resolution){

FILE: dist/db/sqlite/index.cjs
  function concat (line 13) | function concat(arrays){
  function toArray (line 23) | function toArray(val, stringify){
  constant MAXIMUM_QUERY_VARS (line 31) | const MAXIMUM_QUERY_VARS = 16000;
  function sanitize (line 55) | function sanitize(str) {
  constant TRX (line 59) | const TRX = Object.create(null);
  function SqliteDB (line 67) | function SqliteDB(name, config = {}){
  function create_result (line 250) | function create_result(rows, resolve, enrich){
  function build_params (line 361) | function build_params(length, single_param){

FILE: dist/flexsearch.bundle.debug.js
  function H (line 10) | function H(a, c, b) {
  function aa (line 47) | function aa(a, c) {
  function I (line 50) | function I() {
  function N (line 53) | function N(a) {
  function ba (line 56) | function ba(a) {
  function ca (line 59) | function ca(a, c) {
  function ka (line 70) | function ka(a = {}) {
  function la (line 283) | function la(a) {
  function ma (line 288) | function ma(a, c, b) {
  function na (line 305) | function na(a) {
  function xa (line 343) | function xa(a, c, b, e) {
  function Aa (line 359) | function Aa(a) {
  function Q (line 435) | function Q(a = 8) {
  function R (line 453) | function R(a = 8) {
  function Ca (line 502) | function Ca(a) {
  function Ba (line 513) | function Ba(a) {
  function Ea (line 530) | async function Ea(a) {
  function Fa (line 560) | function Fa(a) {
  function Ka (line 569) | function Ka() {
  function Ga (line 572) | function Ga(a) {
  function La (line 594) | function La(a = {}, c) {
  function W (line 641) | function W(a) {
  function Ma (line 656) | function Ma(a, c, b) {
  function Ra (line 746) | function Ra(a, c, b, e, d, f) {
  function Oa (line 760) | function Oa(a, c, b, e, d, f, g, k) {
  function Sa (line 784) | function Sa(a, c, b, e) {
  function Ua (line 817) | function Ua(a, c, b, e) {
  function Va (line 930) | function Va(a, c, b) {
  function Xa (line 941) | function Xa(a, c, b, e, d, f, g) {
  function Za (line 949) | function Za(a, c, b, e, d, f, g) {
  function ab (line 978) | function ab(a, c, b, e, d, f, g) {
  function bb (line 1044) | function bb(a, c, b, e, d, f, g) {
  function cb (line 1084) | function cb(a, c, b, e, d) {
  function X (line 1317) | function X(a, c) {
  function Wa (line 1422) | function Wa(a, c) {
  function $a (line 1469) | function $a(a, c, b, e, d, f, g) {
  function Ya (line 1529) | function Ya(a, c, b, e, d) {
  function db (line 1574) | function db(a, c, b, e, d) {
  function fb (line 1823) | function fb(a) {
  function eb (line 1837) | function eb(a, c, b, e, d) {
  function Ta (line 1855) | function Ta(a) {
  function Na (line 1868) | function Na(a) {
  function ib (line 1975) | function ib(a, c) {
  function hb (line 2002) | function hb(a, c) {
  function lb (line 2076) | function lb(a, c = 0) {
  function mb (line 2085) | function mb(a, c) {
  function nb (line 2092) | function nb(a, c = 0) {
  function ob (line 2101) | function ob(a, c) {
  function pb (line 2108) | function pb(a) {
  function qb (line 2116) | function qb(a, c) {
  function rb (line 2123) | function rb(a, c, b, e, d, f, g = 0) {
  function jb (line 2137) | function jb(a, c, b = 0, e = 0) {
  function kb (line 2170) | function kb(a, c) {
  function sb (line 2206) | function sb(a, c) {
  function tb (line 2249) | function tb(a, c) {
  function Y (line 2356) | function Y(a, c, b, e, d, f, g) {
  function wb (line 2387) | function wb(a, c, b, e, d) {
  function Ab (line 2446) | function Ab(a, c, b, e, d, f, g) {
  function xb (line 2455) | function xb(a, c, b, e, d, f, g) {
  function zb (line 2461) | function zb(a, c, b, e) {
  function yb (line 2482) | function yb(a, c, b, e, d, f, g, k) {
  function T (line 2491) | function T(a, c) {
  function ub (line 2540) | function ub(a) {
  function Eb (line 2634) | function Eb(a, c = {}) {
  function Fb (line 2867) | function Fb(a, c, b) {
  function Z (line 2914) | function Z(a, c) {

FILE: dist/flexsearch.bundle.module.debug.js
  function H (line 9) | function H(a, c, b) {
  function aa (line 46) | function aa(a, c) {
  function I (line 49) | function I() {
  function N (line 52) | function N(a) {
  function ba (line 55) | function ba(a) {
  function ca (line 58) | function ca(a, c) {
  function ka (line 69) | function ka(a = {}) {
  function la (line 282) | function la(a) {
  function ma (line 287) | function ma(a, c, b) {
  function na (line 304) | function na(a) {
  function xa (line 342) | function xa(a, c, b, e) {
  function Aa (line 358) | function Aa(a) {
  function Q (line 434) | function Q(a = 8) {
  function R (line 452) | function R(a = 8) {
  function Ca (line 501) | function Ca(a) {
  function Ba (line 512) | function Ba(a) {
  function Ea (line 529) | async function Ea(a) {
  function Fa (line 559) | function Fa(a) {
  function Ka (line 568) | function Ka() {
  function Ga (line 571) | function Ga(a) {
  function La (line 593) | function La(a = {}, c) {
  function W (line 640) | function W(a) {
  function Ma (line 655) | function Ma(a, c, b) {
  function Ra (line 745) | function Ra(a, c, b, e, d, f) {
  function Qa (line 759) | function Qa(a, c, b, e, d, f, g, k) {
  function Sa (line 783) | function Sa(a, c, b, e) {
  function Ua (line 816) | function Ua(a, c, b, e) {
  function Va (line 929) | function Va(a, c, b) {
  function Xa (line 940) | function Xa(a, c, b, e, d, f, g) {
  function Za (line 948) | function Za(a, c, b, e, d, f, g) {
  function ab (line 977) | function ab(a, c, b, e, d, f, g) {
  function bb (line 1043) | function bb(a, c, b, e, d, f, g) {
  function cb (line 1083) | function cb(a, c, b, e, d) {
  function X (line 1316) | function X(a, c) {
  function Wa (line 1421) | function Wa(a, c) {
  function $a (line 1468) | function $a(a, c, b, e, d, f, g) {
  function Ya (line 1528) | function Ya(a, c, b, e, d) {
  function eb (line 1573) | function eb(a, c, b, e, d) {
  function gb (line 1822) | function gb(a) {
  function fb (line 1836) | function fb(a, c, b, e, d) {
  function Ta (line 1854) | function Ta(a) {
  function Na (line 1867) | function Na(a) {
  function ib (line 1974) | function ib(a, c) {
  function hb (line 2001) | function hb(a, c) {
  function lb (line 2075) | function lb(a, c = 0) {
  function mb (line 2084) | function mb(a, c) {
  function nb (line 2091) | function nb(a, c = 0) {
  function ob (line 2100) | function ob(a, c) {
  function pb (line 2107) | function pb(a) {
  function qb (line 2115) | function qb(a, c) {
  function rb (line 2122) | function rb(a, c, b, e, d, f, g = 0) {
  function jb (line 2136) | function jb(a, c, b = 0, e = 0) {
  function kb (line 2169) | function kb(a, c) {
  function sb (line 2205) | function sb(a, c) {
  function tb (line 2248) | function tb(a, c) {
  function Y (line 2355) | function Y(a, c, b, e, d, f, g) {
  function wb (line 2386) | function wb(a, c, b, e, d) {
  function Ab (line 2445) | function Ab(a, c, b, e, d, f, g) {
  function xb (line 2454) | function xb(a, c, b, e, d, f, g) {
  function zb (line 2460) | function zb(a, c, b, e) {
  function yb (line 2481) | function yb(a, c, b, e, d, f, g, k) {
  function T (line 2490) | function T(a, c) {
  function ub (line 2539) | function ub(a) {
  function Eb (line 2633) | function Eb(a, c = {}) {
  function Fb (line 2866) | function Fb(a, c, b) {
  function Z (line 2913) | function Z(a, c) {

FILE: dist/flexsearch.bundle.module.debug.mjs
  function H (line 9) | function H(a, c, b) {
  function aa (line 46) | function aa(a, c) {
  function I (line 49) | function I() {
  function N (line 52) | function N(a) {
  function ba (line 55) | function ba(a) {
  function ca (line 58) | function ca(a, c) {
  function ka (line 69) | function ka(a = {}) {
  function la (line 282) | function la(a) {
  function ma (line 287) | function ma(a, c, b) {
  function na (line 304) | function na(a) {
  function xa (line 342) | function xa(a, c, b, e) {
  function Aa (line 358) | function Aa(a) {
  function Q (line 434) | function Q(a = 8) {
  function R (line 452) | function R(a = 8) {
  function Ca (line 501) | function Ca(a) {
  function Ba (line 512) | function Ba(a) {
  function Ea (line 529) | async function Ea(a) {
  function Fa (line 559) | function Fa(a) {
  function Ka (line 568) | function Ka() {
  function Ga (line 571) | function Ga(a) {
  function La (line 593) | function La(a = {}, c) {
  function W (line 640) | function W(a) {
  function Ma (line 655) | function Ma(a, c, b) {
  function Ra (line 745) | function Ra(a, c, b, e, d, f) {
  function Qa (line 759) | function Qa(a, c, b, e, d, f, g, k) {
  function Sa (line 783) | function Sa(a, c, b, e) {
  function Ua (line 816) | function Ua(a, c, b, e) {
  function Va (line 929) | function Va(a, c, b) {
  function Xa (line 940) | function Xa(a, c, b, e, d, f, g) {
  function Za (line 948) | function Za(a, c, b, e, d, f, g) {
  function ab (line 977) | function ab(a, c, b, e, d, f, g) {
  function bb (line 1043) | function bb(a, c, b, e, d, f, g) {
  function cb (line 1083) | function cb(a, c, b, e, d) {
  function X (line 1316) | function X(a, c) {
  function Wa (line 1421) | function Wa(a, c) {
  function $a (line 1468) | function $a(a, c, b, e, d, f, g) {
  function Ya (line 1528) | function Ya(a, c, b, e, d) {
  function eb (line 1573) | function eb(a, c, b, e, d) {
  function gb (line 1822) | function gb(a) {
  function fb (line 1836) | function fb(a, c, b, e, d) {
  function Ta (line 1854) | function Ta(a) {
  function Na (line 1867) | function Na(a) {
  function ib (line 1974) | function ib(a, c) {
  function hb (line 2001) | function hb(a, c) {
  function lb (line 2075) | function lb(a, c = 0) {
  function mb (line 2084) | function mb(a, c) {
  function nb (line 2091) | function nb(a, c = 0) {
  function ob (line 2100) | function ob(a, c) {
  function pb (line 2107) | function pb(a) {
  function qb (line 2115) | function qb(a, c) {
  function rb (line 2122) | function rb(a, c, b, e, d, f, g = 0) {
  function jb (line 2136) | function jb(a, c, b = 0, e = 0) {
  function kb (line 2169) | function kb(a, c) {
  function sb (line 2205) | function sb(a, c) {
  function tb (line 2248) | function tb(a, c) {
  function Y (line 2355) | function Y(a, c, b, e, d, f, g) {
  function wb (line 2386) | function wb(a, c, b, e, d) {
  function Ab (line 2445) | function Ab(a, c, b, e, d, f, g) {
  function xb (line 2454) | function xb(a, c, b, e, d, f, g) {
  function zb (line 2460) | function zb(a, c, b, e) {
  function yb (line 2481) | function yb(a, c, b, e, d, f, g, k) {
  function T (line 2490) | function T(a, c) {
  function ub (line 2539) | function ub(a) {
  function Eb (line 2633) | function Eb(a, c = {}) {
  function Fb (line 2866) | function Fb(a, c, b) {
  function Z (line 2913) | function Z(a, c) {

FILE: dist/flexsearch.bundle.module.min.mjs
  function H (line 8) | function H(a,c,b){const e=typeof b,d=typeof a;if(e!=="undefined"){if(d!=...
  function aa (line 8) | function aa(a,c){return typeof a==="undefined"?c:a}
  function I (line 8) | function I(){return Object.create(null)}
  function M (line 9) | function M(a){return typeof a==="string"}
  function ba (line 9) | function ba(a){return typeof a==="object"}
  function ca (line 9) | function ca(a,c){if(M(c))a=a[c];else for(let b=0;a&&b<c.length;b++)a=a[c...
  function ka (line 9) | function ka(a={}){if(!this||this.constructor!==ka)return new ka(...argum...
  function Q (line 19) | function Q(a){a.F=null;a.B.clear();a.D.clear()}
  function la (line 19) | function la(a,c,b){b||(c||typeof a!=="object"?typeof c==="object"&&(b=c,...
  function ma (line 19) | function ma(a){this.limit=a&&a!==!0?a:1E3;this.cache=new Map;this.h=""}
  function wa (line 20) | function wa(a,c,b,e){let d=[];for(let f=0,g;f<a.index.length;f++)if(g=a....
  function xa (line 21) | function xa(a){if(!this||this.constructor!==xa)return new xa(a);this.ind...
  function R (line 23) | function R(a=8){if(!this||this.constructor!==R)return new R(a);this.inde...
  function S (line 24) | function S(a=8){if(!this||this.constructor!==S)return new S(a);this.inde...
  function Ba (line 26) | function Ba(a){let c=2**this.A-1;if(typeof a=="number")return a&c;let b=...
  function Aa (line 26) | function Aa(a){let c=BigInt(2)**this.A-BigInt(1);var b=typeof a;if(b==="...
  function Ea (line 27) | async function Ea(a){a=a.data;var c=a.task;const b=a.id;let e=a.args;swi...
  function Fa (line 28) | function Fa(a){Ga.call(a,"add");Ga.call(a,"append");Ga.call(a,"search");...
  function Ka (line 28) | function Ka(){Ha=Ja=0}
  function Ga (line 29) | function Ga(a){this[a+"Async"]=function(){const c=arguments;var b=c[c.le...
  function La (line 30) | function La(a={},c){function b(k){function h(l){l=l.data||l;const m=l.id...
  function W (line 32) | function W(a){La.prototype[a]=function(){const c=this,b=[].slice.call(ar...
  function Ma (line 33) | function Ma(a,c,b){return c?typeof module!=="undefined"?new(require("wor...
  function Ra (line 36) | function Ra(a,c,b,e,d,f){a=a[d];if(e===b.length-1)c[d]=f||a;else if(a)if...
  function Qa (line 37) | function Qa(a,c,b,e,d,f,g,k){if(a=a[g])if(e===c.length-1){if(a.construct...
  function Sa (line 37) | function Sa(a,c,b,e){if(!a.length)return a;if(a.length===1)return a=a[0]...
  function Ua (line 37) | function Ua(a,c,b,e){var d=e[0];if(d[0]&&d[0].query)return a[c].apply(a,...
  function Va (line 40) | function Va(a,c,b){a=a[c];const e=a[0]||a;e.index||(e.index=b);b=new X(e...
  function Xa (line 40) | function Xa(a,c,b,e,d,f,g){a.length&&(this.result.length&&a.push(this.re...
  function Za (line 40) | function Za(a,c,b,e,d,f,g){if(!f&&!this.result.length)return d?this.resu...
  function ab (line 41) | function ab(a,c,b,e,d,f,g){if(a.length)if(this.result.length&&a.unshift(...
  function bb (line 43) | function bb(a,c,b,e,d,f,g){if(!f&&!this.result.length)return d?this.resu...
  function cb (line 43) | function cb(a,c,b,e,d){let f,g,k;typeof d==="string"?(f=d,d=""):f=d.temp...
  function X (line 49) | function X(a,c){if(!this||this.constructor!==X)return new X(a,c);let b=0...
  function Wa (line 52) | function Wa(a,c){let b=a.result;var e=a.await;a.await=null;for(let d=0,f...
  function $a (line 54) | function $a(a,c,b,e,d,f,g){const k=a.length;let h=[],l,m;l=I();for(let p...
  function Ya (line 56) | function Ya(a,c,b,e,d){const f=[],g=I();let k;var h=a.length;let l;if(e)...
  function eb (line 57) | function eb(a,c,b,e,d){const f=I(),g=[];for(let k=0,h;k<c.length;k++){h=...
  function gb (line 64) | function gb(a){const c=[],b=I(),e=I();for(let d=0,f,g,k,h,l,m,p;d<a.leng...
  function fb (line 64) | function fb(a,c,b,e,d){a=this.tag.get(a);if(!a)return[];a=a.get(c);if(!a...
  function Ta (line 65) | function Ta(a){if(!this||!this.store)return a;if(this.db)return this.ind...
  function Na (line 65) | function Na(a){if(!this||this.constructor!==Na)return new Na(a);const c=...
  function ib (line 70) | function ib(a,c){const b=new Map;let e=c.index||c.field||c;M(e)&&(e=[e])...
  function hb (line 71) | function hb(a,c){const b=a.split(":");let e=0;for(let d=0;d<b.length;d++...
  function lb (line 74) | function lb(a,c=0){let b=[],e=[];c&&(c=25E4/c*5E3|0);for(const d of a.en...
  function mb (line 74) | function mb(a,c){c||(c=new Map);for(let b=0,e;b<a.length;b++)e=a[b],c.se...
  function nb (line 74) | function nb(a,c=0){let b=[],e=[];c&&(c=25E4/c*1E3|0);for(const d of a.en...
  function ob (line 75) | function ob(a,c){c||(c=new Map);for(let b=0,e,d;b<a.length;b++)e=a[b],d=...
  function pb (line 75) | function pb(a){let c=[],b=[];for(const e of a.keys())b.push(e),b.length=...
  function qb (line 75) | function qb(a,c){c||(c=new Set);for(let b=0;b<a.length;b++)c.add(a[b]);r...
  function rb (line 76) | function rb(a,c,b,e,d,f,g=0){const k=e&&e.constructor===Array;var h=k?e....
  function jb (line 77) | function jb(a,c,b=0,e=0){if(b<this.field.length){const g=this.field[b];i...
  function kb (line 78) | function kb(a,c){var b=a.split(".");b[b.length-1]==="json"&&b.pop();cons...
  function sb (line 79) | function sb(a,c){let b="";for(const e of a.entries()){a=e[0];const d=e[1...
  function tb (line 80) | function tb(a,c){let b=0;var e=typeof c==="undefined";if(a.constructor==...
  function Y (line 83) | function Y(a,c,b,e,d,f,g){let k,h;if(!(k=c[b])||g&&!k[g]){g?(c=k||(c[b]=...
  function wb (line 84) | function wb(a,c,b,e,d){return b&&a>1?c+(e||0)<=a?b+(d||0):(a-1)/(c+(e||0...
  function Ab (line 86) | function Ab(a,c,b,e,d,f,g){let k=a.length,h=a;if(k>1)h=$a(a,c,b,e,d,f,g)...
  function xb (line 87) | function xb(a,c,b,e,d,f,g){a=yb(this,a,c,b,e,d,f,g);return this.db?a.the...
  function zb (line 87) | function zb(a,c,b,e){let d=[];if(a&&a.length){if(a.length<=e){c.push(a);...
  function yb (line 88) | function yb(a,c,b,e,d,f,g,k){let h;b&&(h=a.bidirectional&&c>b)&&(h=b,b=c...
  function T (line 88) | function T(a,c){if(!this||this.constructor!==T)return new T(a);if(a){var...
  function ub (line 90) | function ub(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.c...
  function Eb (line 95) | function Eb(a,c={}){if(!this||this.constructor!==Eb)return new Eb(a,c);t...
  function Fb (line 105) | function Fb(a,c,b){const e=a.value;let d,f=0;for(let g=0,k;g<e.length;g+...
  function Z (line 107) | function Z(a,c){return new Promise((b,e)=>{a.onsuccess=a.oncomplete=func...

FILE: dist/flexsearch.compact.debug.js
  function J (line 10) | function J(a, c, b) {
  function K (line 47) | function K(a, c) {
  function M (line 50) | function M() {
  function P (line 53) | function P(a) {
  function Q (line 56) | function Q(a) {
  function aa (line 59) | function aa(a, c) {
  function la (line 70) | function la(a = {}) {
  function S (line 283) | function S(a) {
  function ma (line 288) | function ma(a, c, b) {
  function T (line 305) | function T(a) {
  function wa (line 343) | function wa(a) {
  function Aa (line 352) | function Aa() {
  function U (line 355) | function U(a) {
  function Ca (line 449) | function Ca(a, c, b, e, d, f) {
  function Ba (line 463) | function Ba(a, c, b, e, d, f, g, h) {
  function Da (line 487) | function Da(a, c, b) {
  function Ea (line 519) | function Ea(a, c, b, e, d) {
  function Fa (line 752) | function Fa(a, c, b, e) {
  function Ia (line 929) | function Ia(a) {
  function Ga (line 943) | function Ga(a, c, b, e, d) {
  function Ha (line 961) | function Ha(a) {
  function X (line 971) | function X(a) {
  function Ja (line 1020) | function Ja(a, c) {
  function Na (line 1093) | function Na(a, c = 0) {
  function Oa (line 1102) | function Oa(a, c) {
  function Pa (line 1109) | function Pa(a, c = 0) {
  function Qa (line 1118) | function Qa(a, c) {
  function Ra (line 1125) | function Ra(a) {
  function Sa (line 1133) | function Sa(a, c) {
  function Ta (line 1140) | function Ta(a, c, b, e, d, f, g = 0) {
  function La (line 1154) | function La(a, c, b = 0, e = 0) {
  function Ma (line 1187) | function Ma(a, c) {
  function Ua (line 1213) | function Ua(a, c) {
  function Va (line 1255) | function Va(a, c) {
  function Z (line 1361) | function Z(a, c, b, e, d, f, g) {
  function Xa (line 1383) | function Xa(a, c, b, e, d) {
  function Ya (line 1523) | function Ya(a, c, b) {
  function Y (line 1529) | function Y(a, c) {

FILE: dist/flexsearch.compact.module.debug.js
  function J (line 9) | function J(a, c, b) {
  function K (line 46) | function K(a, c) {
  function M (line 49) | function M() {
  function P (line 52) | function P(a) {
  function Q (line 55) | function Q(a) {
  function aa (line 58) | function aa(a, c) {
  function la (line 69) | function la(a = {}) {
  function S (line 282) | function S(a) {
  function ma (line 287) | function ma(a, c, b) {
  function T (line 304) | function T(a) {
  function wa (line 342) | function wa(a) {
  function Aa (line 351) | function Aa() {
  function U (line 354) | function U(a) {
  function Ca (line 448) | function Ca(a, c, b, e, d, f) {
  function Ba (line 462) | function Ba(a, c, b, e, d, f, g, h) {
  function Da (line 486) | function Da(a, c, b) {
  function Ea (line 518) | function Ea(a, c, b, e, d) {
  function Fa (line 751) | function Fa(a, c, b, e) {
  function Ja (line 928) | function Ja(a) {
  function Ga (line 942) | function Ga(a, c, b, e, d) {
  function Ia (line 960) | function Ia(a) {
  function X (line 970) | function X(a) {
  function Ka (line 1019) | function Ka(a, c) {
  function Na (line 1092) | function Na(a, c = 0) {
  function Oa (line 1101) | function Oa(a, c) {
  function Pa (line 1108) | function Pa(a, c = 0) {
  function Qa (line 1117) | function Qa(a, c) {
  function Ra (line 1124) | function Ra(a) {
  function Sa (line 1132) | function Sa(a, c) {
  function Ta (line 1139) | function Ta(a, c, b, e, d, f, g = 0) {
  function La (line 1153) | function La(a, c, b = 0, e = 0) {
  function Ma (line 1186) | function Ma(a, c) {
  function Ua (line 1212) | function Ua(a, c) {
  function Va (line 1254) | function Va(a, c) {
  function Z (line 1360) | function Z(a, c, b, e, d, f, g) {
  function Xa (line 1382) | function Xa(a, c, b, e, d) {
  function Ya (line 1522) | function Ya(a, c, b) {
  function Y (line 1528) | function Y(a, c) {

FILE: dist/flexsearch.es5.debug.js
  function aa (line 10) | function aa(a) {
  function D (line 16) | function D(a) {
  function da (line 33) | function da(a) {
  function H (line 44) | function H(a, b) {
  function la (line 87) | function la() {
  function ma (line 95) | function ma(a) {
  function na (line 104) | function na(a, b) {
  function L (line 112) | function L(a, b, c) {
  function pa (line 116) | function pa(a) {
  function qa (line 120) | function qa(a, b) {
  function ra (line 131) | function ra(a, b, c, d) {
  function sa (line 148) | function sa(a) {
  function ta (line 170) | function ta(a) {
  function ua (line 188) | function ua(a, b) {
  function va (line 193) | function va(a) {
  function wa (line 207) | function wa(a) {
  function b (line 211) | function b(f) {
  function c (line 217) | function c(f, g) {
  function xa (line 243) | function xa(a) {
  function b (line 251) | function b(g) {
  function c (line 263) | function c() {
  function d (line 266) | function d(g) {
  function g (line 310) | function g(l) {
  function k (line 410) | function k(n, q) {
  function k (line 430) | function k() {
  function p (line 462) | function p(t) {
  function ya (line 477) | function ya(a, b) {
  function za (line 506) | function za(a, b) {
  function b (line 510) | function b(k) {
  function c (line 519) | function c() {
  function d (line 521) | function d(k) {
  function e (line 525) | function e(k) {
  function f (line 531) | function f(k) {
  function b (line 587) | function b() {
  function c (line 591) | function c(h, k) {
  function d (line 606) | function d(h, k) {
  function e (line 620) | function e(h) {
  function b (line 700) | function b(c) {
  function Q (line 840) | function Q(a, b, c) {
  function Ba (line 879) | function Ba(a, b) {
  function S (line 882) | function S() {
  function U (line 885) | function U(a) {
  function Ca (line 888) | function Ca(a) {
  function Da (line 891) | function Da(a, b) {
  function Ja (line 902) | function Ja(a) {
  function Ka (line 1127) | function Ka(a) {
  function La (line 1132) | function La(a, b, c) {
  function Ma (line 1152) | function Ma(a) {
  function Ua (line 1189) | function Ua(a, b, c, d) {
  function Va (line 1205) | function Va(a) {
  function X (line 1280) | function X(a) {
  function Y (line 1298) | function Y(a) {
  function Xa (line 1404) | function Xa(a) {
  function Wa (line 1414) | function Wa() {
  function cb (line 1418) | function cb(a) {
  function eb (line 1482) | function eb(a) {
  function jb (line 1491) | function jb() {
  function fb (line 1494) | function fb(a) {
  function lb (line 1519) | function lb(a, b) {
  function nb (line 1567) | function nb(a) {
  function mb (line 1583) | function mb(a, b, c) {
  function qb (line 1676) | function qb(a, b, c, d, e, f) {
  function pb (line 1690) | function pb(a, b, c, d, e, f, g, h) {
  function rb (line 1714) | function rb(a, b, c, d) {
  function tb (line 1746) | function tb(a, b, c, d) {
  function ub (line 1867) | function ub(a, b, c) {
  function wb (line 1878) | function wb(a, b, c, d, e, f, g) {
  function yb (line 1886) | function yb(a, b, c, d, e, f, g) {
  function Ab (line 1918) | function Ab(a, b, c, d, e, f, g) {
  function Bb (line 1982) | function Bb(a, b, c, d, e, f, g) {
  function Cb (line 2022) | function Cb(a, b, c, d, e) {
  function Z (line 2255) | function Z(a, b) {
  function vb (line 2358) | function vb(a, b) {
  function zb (line 2404) | function zb(a, b, c, d, e, f, g) {
  function xb (line 2464) | function xb(a, b, c, d, e) {
  function Db (line 2507) | function Db(a, b, c, d, e) {
  function Fb (line 2758) | function Fb(a) {
  function Eb (line 2771) | function Eb(a, b, c, d, e) {
  function sb (line 2789) | function sb(a) {
  function ob (line 2801) | function ob(a) {
  function Hb (line 2917) | function Hb(a, b) {
  function Gb (line 2940) | function Gb(a, b) {
  function Kb (line 3013) | function Kb(a, b) {
  function Lb (line 3024) | function Lb(a, b) {
  function Mb (line 3031) | function Mb(a, b) {
  function Nb (line 3042) | function Nb(a, b) {
  function Ob (line 3049) | function Ob(a) {
  function Pb (line 3058) | function Pb(a, b) {
  function Qb (line 3065) | function Qb(a, b, c, d, e, f, g) {
  function Ib (line 3079) | function Ib(a, b, c, d) {
  function Jb (line 3113) | function Jb(a, b) {
  function Rb (line 3150) | function Rb(a, b) {
  function Sb (line 3193) | function Sb(a, b) {
  function Wb (line 3289) | function Wb(a, b, c, d, e, f, g) {
  function Vb (line 3327) | function Vb(a, b, c, d, e) {
  function $b (line 3420) | function $b(a, b, c, d, e, f, g) {
  function Xb (line 3429) | function Xb(a, b, c, d, e, f, g) {
  function Zb (line 3435) | function Zb(a, b, c, d) {
  function Yb (line 3456) | function Yb(a, b, c, d, e, f, g, h) {
  function db (line 3465) | function db(a, b) {
  function Tb (line 3514) | function Tb(a) {
  function dc (line 3615) | function dc(a, b) {
  function fc (line 3887) | function fc(a, b, c) {
  function ec (line 3932) | function ec(a, b) {

FILE: dist/flexsearch.light.debug.js
  function v (line 10) | function v(a, c, b) {
  function z (line 47) | function z() {
  function F (line 51) | function F(a = {}) {
  function G (line 264) | function G(a) {
  function H (line 269) | function H(a, c, b) {
  function K (line 323) | function K(a, c) {
  function N (line 429) | function N(a, c, b, f, d, h, e) {
  function M (line 451) | function M(a, c, b, f, d) {
  function O (line 588) | function O(a, c, b) {
  function J (line 594) | function J(a, c) {

FILE: dist/flexsearch.light.module.debug.js
  function v (line 9) | function v(a, c, b) {
  function z (line 46) | function z() {
  function F (line 50) | function F(a = {}) {
  function G (line 263) | function G(a) {
  function I (line 268) | function I(a, c, b) {
  function K (line 322) | function K(a, c) {
  function N (line 428) | function N(a, c, b, f, d, h, e) {
  function M (line 450) | function M(a, c, b, f, d) {
  function O (line 587) | function O(a, c, b) {
  function J (line 593) | function J(a, c) {

FILE: dist/module-debug/async.js
  function tick (line 19) | function tick() {
  function register (line 28) | function register(key) {

FILE: dist/module-debug/cache.js
  function searchCache (line 11) | function searchCache(query, limit, options) {
  function CacheClass (line 66) | function CacheClass(limit) {

FILE: dist/module-debug/charset.js
  constant CJK (line 18) | const CJK = charset_cjk;

FILE: dist/module-debug/charset/latin/soundex.js
  function soundex (line 28) | function soundex(stringToEncode) {

FILE: dist/module-debug/common.js
  function merge_option (line 7) | function merge_option(value, default_value, merge_value) {
  function inherit (line 64) | function inherit(target_value, default_value) {
  function create_object (line 68) | function create_object() {
  function concat (line 72) | function concat(arrays) {
  function sort_by_length_down (line 76) | function sort_by_length_down(a, b) {
  function sort_by_length_up (line 80) | function sort_by_length_up(a, b) {
  function is_array (line 84) | function is_array(val) {
  function is_string (line 88) | function is_string(val) {
  function is_object (line 92) | function is_object(val) {
  function is_function (line 96) | function is_function(val) {
  function toArray (line 106) | function toArray(val, stringify) {
  function parse_simple (line 114) | function parse_simple(obj, tree) {
  function get_max_len (line 125) | function get_max_len(arr) {

FILE: dist/module-debug/compress.js
  function toRadix (line 5) | function toRadix(number, radix = 255) {
  function lcg (line 48) | function lcg(str) {
  function clear (line 61) | function clear() {

FILE: dist/module-debug/db/clickhouse/index.js
  constant VERSION (line 4) | const defaults = {
  function sanitize (line 46) | function sanitize(str) {
  function ClickhouseDB (line 57) | function ClickhouseDB(name, config = {}) {
  function create_result (line 188) | function create_result(rows, resolve, enrich) {

FILE: dist/module-debug/db/indexeddb/index.js
  constant VERSION (line 1) | const VERSION = 1,
  function sanitize (line 14) | function sanitize(str) {
  function IdxDB (line 27) | function IdxDB(name, config = {}) {
  function handle (line 424) | function handle(cursor, ids, _tag) {
  function promisfy (line 504) | function promisfy(req, callback) {

FILE: dist/module-debug/db/interface.js
  function StorageInterface (line 6) | function StorageInterface() {}

FILE: dist/module-debug/db/mongodb/index.js
  constant VERSION (line 2) | const defaults = {
  function sanitize (line 14) | function sanitize(str) {
  constant CLIENT (line 18) | let CLIENT,
  function MongoDB (line 27) | function MongoDB(name, config = {}) {
  function createCollection (line 57) | async function createCollection(db, ref, field) {
  function clear (line 133) | async function clear(ref) {
  function create_result (line 142) | function create_result(rows, resolve, enrich) {

FILE: dist/module-debug/db/postgres/index.js
  constant VERSION (line 4) | const defaults = {
  constant MAXIMUM_QUERY_VARS (line 4) | const defaults = {
  function sanitize (line 39) | function sanitize(str) {
  constant TRX (line 43) | let DB, TRX;
  function PostgresDB (line 50) | function PostgresDB(name, config = {}) {
  function create_result (line 201) | function create_result(rows, resolve, enrich) {

FILE: dist/module-debug/db/redis/index.js
  constant VERSION (line 5) | const VERSION = 1,
  constant TRX (line 14) | let DB, TRX;
  function sanitize (line 16) | function sanitize(str) {
  function RedisDB (line 24) | function RedisDB(name, config = {}) {
  function unlink (line 87) | function unlink(keys) {
  function create_result (line 93) | function create_result(range, type, resolve, enrich, resolution) {

FILE: dist/module-debug/db/sqlite/index.js
  constant VERSION (line 7) | const VERSION = 1,
  constant MAXIMUM_QUERY_VARS (line 7) | const VERSION = 1,
  function sanitize (line 33) | function sanitize(str) {
  constant TRX (line 37) | const TRX = Object.create(null),
  function SqliteDB (line 46) | function SqliteDB(name, config = {}) {
  function create_result (line 224) | function create_result(rows, resolve, enrich) {
  function build_params (line 329) | function build_params(length, single_param) {

FILE: dist/module-debug/document.js
  function Document (line 30) | function Document(options) {
  function parse_descriptor (line 225) | function parse_descriptor(options, document) {
  function parse_tree (line 308) | function parse_tree(key, marker) {

FILE: dist/module-debug/document/add.js
  function store_value (line 171) | function store_value(obj, store, tree, pos, key, custom) {
  function add_index (line 197) | function add_index(obj, tree, marker, pos, index, id, key, _append) {

FILE: dist/module-debug/document/highlight.js
  function highlight_fields (line 15) | function highlight_fields(query, result, index, pluck, config) {

FILE: dist/module-debug/document/search.js
  function merge_fields (line 455) | function merge_fields(fields) {
  function get_tag (line 493) | function get_tag(tag, key, limit, offset, enrich) {
  function apply_enrich (line 518) | function apply_enrich(ids) {

FILE: dist/module-debug/encoder.js
  function Encoder (line 58) | function Encoder(options = {}) {
  function fallback_encoder (line 446) | function fallback_encoder(str) {
  function clear (line 453) | function clear(self) {

FILE: dist/module-debug/index.js
  function Index (line 31) | function Index(options, _register) {
  function autoCommit (line 117) | function autoCommit(self) {

FILE: dist/module-debug/index/add.js
  function get_score (line 226) | function get_score(resolution, length, i, term_length, x) {

FILE: dist/module-debug/index/remove.js
  function remove_index (line 59) | function remove_index(map, id) {

FILE: dist/module-debug/index/search.js
  function return_result (line 199) | function return_result(result, resolution, limit, offset, suggest, boost...
  function single_term_query (line 228) | function single_term_query(term, keyword, limit, offset, resolve, enrich...
  function add_result (line 254) | function add_result(arr, result, suggest, resolution) {

FILE: dist/module-debug/intersect.js
  function intersect (line 27) | function intersect(arrays, resolution, limit, offset, suggest, boost, re...
  function union (line 138) | function union(arrays, limit, offset, resolve, boost) {
  function intersect_union (line 215) | function intersect_union(arrays, mandatory, limit, offset, resolve) {

FILE: dist/module-debug/keystore.js
  function _slice (line 3) | function _slice(self, start, end, splice) {
  function KeystoreArray (line 30) | function KeystoreArray(arr) {
  function Keystore (line 123) | function Keystore() {
  function KeystoreMap (line 141) | function KeystoreMap(bitlength = 8) {
  function KeystoreSet (line 196) | function KeystoreSet(bitlength = 8) {
  function lcg (line 313) | function lcg(str) {
  function lcg64 (line 332) | function lcg64(str) {

FILE: dist/module-debug/preset.js
  function apply_preset (line 43) | function apply_preset(options) {

FILE: dist/module-debug/profiler.js
  function tick (line 9) | function tick() {}

FILE: dist/module-debug/resolve/and.js
  function return_result (line 39) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: dist/module-debug/resolve/handler.js
  function inner_call (line 219) | function inner_call(query, method, index) {

FILE: dist/module-debug/resolve/not.js
  function return_result (line 26) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusion (line 54) | function exclusion(result, limit, offset, resolve) {

FILE: dist/module-debug/resolve/or.js
  function return_result (line 29) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: dist/module-debug/resolve/xor.js
  function return_result (line 28) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusive (line 63) | function exclusive(result, limit, offset, resolve, boost) {

FILE: dist/module-debug/resolver.js
  function Resolver (line 21) | function Resolver(result, index) {

FILE: dist/module-debug/serialize.js
  function map_to_json (line 17) | function map_to_json(map, size = 0) {
  function json_to_map (line 40) | function json_to_map(json, map) {
  function ctx_to_json (line 55) | function ctx_to_json(ctx, size = 0) {
  function json_to_ctx (line 81) | function json_to_ctx(json, ctx) {
  function reg_to_json (line 100) | function reg_to_json(reg) {
  function json_to_reg (line 128) | function json_to_reg(json, reg) {
  function save (line 149) | function save(callback, field, key, chunk, index_doc, index_obj, index_p...
  function exportIndex (line 177) | function exportIndex(callback, _field, _index_doc = 0, _index_obj = 0) {
  function importIndex (line 221) | function importIndex(key, data) {
  function exportDocument (line 271) | function exportDocument(callback, _field, _index_doc = 0, _index_obj = 0) {
  function importDocument (line 331) | function importDocument(key, data) {
  function serialize (line 415) | function serialize(withFunctionWrapper = !0) {
  function parse_map (line 448) | function parse_map(map, type) {

FILE: dist/module-debug/worker.js
  function WorkerIndex (line 17) | function WorkerIndex(options = /** @type IndexOptions */{}, encoder) {
  function register (line 108) | function register(key) {
  function create (line 145) | function create(factory, is_node_js, worker_path) {

FILE: dist/module-min/async.js
  function tick (line 1) | function tick(){timer=cycle=0}
  function register (line 1) | function register(a){this[a+"Async"]=function(){const b=arguments,c=b[b....

FILE: dist/module-min/cache.js
  function searchCache (line 1) | function searchCache(a,b,c){c||(b||"object"!=typeof a?"object"==typeof b...
  function CacheClass (line 1) | function CacheClass(a){this.limit=a&&!0!==a?a:1000,this.cache=new Map,th...

FILE: dist/module-min/charset.js
  constant CJK (line 1) | const CJK=charset_cjk;

FILE: dist/module-min/charset/latin/soundex.js
  function soundex (line 1) | function soundex(a){let b=a.charAt(0),c=codes[b];for(let d,e=1;e<a.lengt...

FILE: dist/module-min/common.js
  function merge_option (line 1) | function merge_option(a,b,c){const d=typeof c,e=typeof a;if("undefined"!...
  function inherit (line 1) | function inherit(a,b){return"undefined"==typeof a?b:a}
  function create_object (line 1) | function create_object(){return Object.create(null)}
  function concat (line 1) | function concat(a){return[].concat.apply([],a)}
  function sort_by_length_down (line 1) | function sort_by_length_down(c,a){return a.length-c.length}
  function sort_by_length_up (line 1) | function sort_by_length_up(c,a){return c.length-a.length}
  function is_array (line 1) | function is_array(a){return a.constructor===Array}
  function is_string (line 1) | function is_string(a){return"string"==typeof a}
  function is_object (line 1) | function is_object(a){return"object"==typeof a}
  function is_function (line 1) | function is_function(a){return"function"==typeof a}
  function toArray (line 1) | function toArray(a,b){const c=[];for(const d of a.keys())c.push(b?""+d:d...
  function parse_simple (line 1) | function parse_simple(a,b){if(is_string(b))a=a[b];else for(let c=0;a&&c<...
  function get_max_len (line 1) | function get_max_len(a){let b=0;for(let c,d=0;d<a.length;d++)(c=a[d])&&b...

FILE: dist/module-min/compress.js
  function toRadix (line 1) | function toRadix(a,b=255){if(!table){table=Array(b);for(let a=0;a<b;a++)...
  function lcg (line 1) | function lcg(a){if("number"==typeof a)return a&4294967295;let b=0;for(le...
  function clear (line 1) | function clear(){timer=null,cache.clear()}

FILE: dist/module-min/db/clickhouse/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_]/g,"")}
  function ClickhouseDB (line 1) | function ClickhouseDB(a,b={}){if(!this||this.constructor!==ClickhouseDB)...
  function create_result (line 44) | function create_result(a,b,c){if(b){for(let b=0;b<a.length;b++)c?a[b].do...

FILE: dist/module-min/db/indexeddb/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_\-]/g,"")}
  function IdxDB (line 1) | function IdxDB(a,b={}){return this&&this.constructor===IdxDB?void("objec...
  function handle (line 1) | function handle(a,b,c){const d=a.value;let e,f=0;for(let g,h=0;h<d.lengt...
  function promisfy (line 1) | function promisfy(a,b){return new Promise((c,d)=>{a.onsuccess=a.oncomple...

FILE: dist/module-min/db/interface.js
  function StorageInterface (line 1) | function StorageInterface(){}

FILE: dist/module-min/db/mongodb/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_\-]/g,"")}
  function MongoDB (line 1) | function MongoDB(a,b={}){return this&&this.constructor===MongoDB?void("o...
  function createCollection (line 1) | async function createCollection(a,b,c){"map"===b?(await a.createCollecti...
  function clear (line 1) | async function clear(a){await this.db.dropCollection(a),await createColl...
  function create_result (line 1) | function create_result(a,b,c){const d=a[0]&&"undefined"!=typeof a[0]._id...

FILE: dist/module-min/db/postgres/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_]/g,"")}
  function PostgresDB (line 1) | function PostgresDB(a,b={}){if(!this||this.constructor!==PostgresDB)retu...
  function create_result (line 65) | function create_result(a,b,c){if(b){for(let b=0;b<a.length;b++)c?a[b].do...

FILE: dist/module-min/db/redis/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_\-]/g,"")}
  function RedisDB (line 1) | function RedisDB(a,b={}){return this&&this.constructor===RedisDB?void("o...
  function b (line 1) | function b(a){return a.length&&c.db.unlink(a)}
  function create_result (line 1) | function create_result(a,b,c,d,e){if(c){for(let c,e,f=0;f<a.length;f++)c...

FILE: dist/module-min/db/sqlite/index.js
  function sanitize (line 1) | function sanitize(a){return a.toLowerCase().replace(/[^a-z0-9_]/g,"")}
  function SqliteDB (line 1) | function SqliteDB(a,b={}){if(!this||this.constructor!==SqliteDB)return n...
  function create_result (line 49) | function create_result(a,b,c){if(b){for(let b=0;b<a.length;b++)c?a[b].do...
  function build_params (line 83) | function build_params(a,b){let c=b?",(?)":",?";for(let d=1;d<a;)if(d<=a-...

FILE: dist/module-min/document.js
  function Document (line 1) | function Document(a){if(!this||this.constructor!==Document)return new Do...
  function parse_descriptor (line 1) | function parse_descriptor(a,b){const c=new Map;let d=b.index||b.field||b...
  function parse_tree (line 1) | function parse_tree(a,b){const c=a.split(":");let d=0;for(let e=0;e<c.le...

FILE: dist/module-min/document/add.js
  function store_value (line 1) | function store_value(a,b,c,d,e,f){if(a=a[e],d===c.length-1)b[e]=f||a;els...
  function add_index (line 1) | function add_index(a,b,c,d,e,f,g,h){if(a=a[g])if(d===b.length-1){if(is_a...

FILE: dist/module-min/document/highlight.js
  function highlight_fields (line 1) | function highlight_fields(a,b,c,d,e){let f,g,h;"string"==typeof e?(f=e,e...

FILE: dist/module-min/document/search.js
  function merge_fields (line 1) | function merge_fields(a){const b=[],c=create_object(),d=create_object();...
  function get_tag (line 1) | function get_tag(a,b,c,d,e){let f=this.tag.get(a);if(!f)return[];if(f=f....
  function apply_enrich (line 1) | function apply_enrich(a){if(!this||!this.store)return a;if(this.db)retur...

FILE: dist/module-min/encoder.js
  function Encoder (line 1) | function Encoder(a={}){if(!this||this.constructor!==Encoder)return new E...
  function fallback_encoder (line 1) | function fallback_encoder(a){return a.normalize("NFKD").replace(normaliz...
  function clear (line 1) | function clear(a){a.timer=null,a.cache_enc.clear(),a.cache_term.clear()}

FILE: dist/module-min/index.js
  function Index (line 1) | function Index(a,b){if(!this||this.constructor!==Index)return new Index(...
  function autoCommit (line 1) | function autoCommit(a){a.commit_timer||(a.commit_timer=setTimeout(functi...

FILE: dist/module-min/index/add.js
  function get_score (line 1) | function get_score(a,b,c,d,e){return c&&1<a?b+(d||0)<=a?c+(e||0):0|(a-1)...

FILE: dist/module-min/index/remove.js
  function remove_index (line 1) | function remove_index(a,b){let c=0;if(is_array(a)){for(let d,e,f,g=0;g<a...

FILE: dist/module-min/index/search.js
  function return_result (line 1) | function return_result(a,b,c,d,e,f,g){let h=a.length,i=a;if(1<h)i=inters...
  function single_term_query (line 1) | function single_term_query(a,b,c,d,e,f,g){const h=this._get_array(a,b,c,...
  function add_result (line 1) | function add_result(a,b,c,d){let e=[];if(a&&a.length){if(a.length<=d)ret...

FILE: dist/module-min/intersect.js
  function intersect (line 1) | function intersect(a,b,c,d,e,f,g){const h=a.length;let i,j,k=[];i=create...
  function union (line 1) | function union(a,b,c,d,e){const f=[],g=create_object();let h,l,m,n=a.len...
  function intersect_union (line 1) | function intersect_union(a,b,c,d,e){const f=create_object(),g=[];for(let...

FILE: dist/module-min/keystore.js
  function _slice (line 1) | function _slice(a,b,c,d){let e=[];for(let f,g=0;g<a.index.length;g++)if(...
  function KeystoreArray (line 1) | function KeystoreArray(a){if(!this||this.constructor!==KeystoreArray)ret...
  function Keystore (line 1) | function Keystore(){this.index,this.refs,this.size,this.crc,this.bit}
  function KeystoreMap (line 1) | function KeystoreMap(a=8){return this&&this.constructor===KeystoreMap?vo...
  function KeystoreSet (line 1) | function KeystoreSet(a=8){return this&&this.constructor===KeystoreSet?vo...
  function lcg (line 1) | function lcg(a){let b=2**this.bit-1;if("number"==typeof a)return a&b;let...
  function lcg64 (line 1) | function lcg64(a){let b=BigInt(2)**this.bit-BigInt(1),c=typeof a;if("big...

FILE: dist/module-min/preset.js
  function apply_preset (line 1) | function apply_preset(a){const b=is_string(a)?a:a.preset;return b&&(!1,a...

FILE: dist/module-min/profiler.js
  function tick (line 1) | function tick(){}

FILE: dist/module-min/resolve/and.js
  function return_result (line 1) | function return_result(a,b,c,d,e,f,g){if(!f&&!this.result.length)return ...

FILE: dist/module-min/resolve/handler.js
  function inner_call (line 1) | function inner_call(a,b,c){const d=a[b],e=d[0]||d;e.index||(e.index=c);l...

FILE: dist/module-min/resolve/not.js
  function return_result (line 1) | function return_result(a,b,c,d,e,f,g){if(!f&&!this.result.length)return ...
  function exclusion (line 1) | function exclusion(a,b,c,d){const e=[],f=new Set(a.flat().flat());for(le...

FILE: dist/module-min/resolve/or.js
  function return_result (line 1) | function return_result(a,b,c,d,e,f,g){return a.length&&(this.result.leng...

FILE: dist/module-min/resolve/xor.js
  function return_result (line 1) | function return_result(a,b,c,d,e,f,g){let h;return a.length?(this.result...
  function exclusive (line 1) | function exclusive(a,b,c,d,e){const f=[],g=create_object();let h=0;for(l...

FILE: dist/module-min/resolver.js
  function Resolver (line 1) | function Resolver(a,b){if(!this||this.constructor!==Resolver)return new ...

FILE: dist/module-min/serialize.js
  function map_to_json (line 1) | function map_to_json(a,b=0){let c=[],d=[];b&&(b=0|chunk_size_map*(chunk_...
  function json_to_map (line 1) | function json_to_map(a,b){b||(b=new Map);for(let c,d=0;d<a.length;d++)c=...
  function ctx_to_json (line 1) | function ctx_to_json(a,b=0){let c=[],d=[];b&&(b=0|chunk_size_ctx*(chunk_...
  function json_to_ctx (line 1) | function json_to_ctx(a,b){b||(b=new Map);for(let c,d,e=0;e<a.length;e++)...
  function reg_to_json (line 1) | function reg_to_json(a){let b=[],c=[];for(const d of a.keys())c.push(d),...
  function json_to_reg (line 1) | function json_to_reg(a,b){b||(b=new Set);for(let c=0;c<a.length;c++)b.ad...
  function save (line 1) | function save(a,b,c,d,e,f,g=0){const h=d&&d.constructor===Array,i=h?d.sh...
  function exportIndex (line 1) | function exportIndex(a,b,c=0,d=0){let e,f;switch(d){case 0:e="reg",f=reg...
  function importIndex (line 1) | function importIndex(a,b){if(b){"string"==typeof b&&(b=JSON.parse(b));co...
  function exportDocument (line 1) | function exportDocument(a,b,c=0,d=0){if(c<this.field.length){const b=thi...
  function importDocument (line 1) | function importDocument(a,b){const c=a.split(".");"json"===c[c.length-1]...
  function serialize (line 1) | function serialize(a=!0){let b="",c="",d="";if(this.reg.size){let a;for(...
  function parse_map (line 1) | function parse_map(a,b){let c="";for(const d of a.entries()){const a=d[0...

FILE: dist/module-min/worker.js
  function WorkerIndex (line 1) | function WorkerIndex(a={},b){function c(c){function g(a){a=a.data||a;con...
  function register (line 1) | function register(a){WorkerIndex.prototype[a]=function(){const b=this,c=...
  function create (line 1) | function create(a,b,c){return b?"undefined"==typeof module?import("worke...

FILE: dist/module/async.js
  function tick (line 19) | function tick() {
  function register (line 28) | function register(key) {

FILE: dist/module/cache.js
  function searchCache (line 11) | function searchCache(query, limit, options) {
  function CacheClass (line 66) | function CacheClass(limit) {

FILE: dist/module/charset.js
  constant CJK (line 18) | const CJK = charset_cjk;

FILE: dist/module/charset/latin/soundex.js
  function soundex (line 28) | function soundex(stringToEncode) {

FILE: dist/module/common.js
  function merge_option (line 7) | function merge_option(value, default_value, merge_value) {
  function inherit (line 64) | function inherit(target_value, default_value) {
  function create_object (line 68) | function create_object() {
  function concat (line 72) | function concat(arrays) {
  function sort_by_length_down (line 76) | function sort_by_length_down(a, b) {
  function sort_by_length_up (line 80) | function sort_by_length_up(a, b) {
  function is_array (line 84) | function is_array(val) {
  function is_string (line 88) | function is_string(val) {
  function is_object (line 92) | function is_object(val) {
  function is_function (line 96) | function is_function(val) {
  function toArray (line 106) | function toArray(val, stringify) {
  function parse_simple (line 114) | function parse_simple(obj, tree) {
  function get_max_len (line 125) | function get_max_len(arr) {

FILE: dist/module/compress.js
  function toRadix (line 5) | function toRadix(number, radix = 255) {
  function lcg (line 48) | function lcg(str) {
  function clear (line 61) | function clear() {

FILE: dist/module/db/clickhouse/index.js
  constant VERSION (line 4) | const defaults = {
  function sanitize (line 46) | function sanitize(str) {
  function ClickhouseDB (line 57) | function ClickhouseDB(name, config = {}) {
  function create_result (line 188) | function create_result(rows, resolve, enrich) {

FILE: dist/module/db/indexeddb/index.js
  constant VERSION (line 1) | const VERSION = 1,
  function sanitize (line 14) | function sanitize(str) {
  function IdxDB (line 27) | function IdxDB(name, config = {}) {
  function handle (line 424) | function handle(cursor, ids, _tag) {
  function promisfy (line 504) | function promisfy(req, callback) {

FILE: dist/module/db/interface.js
  function StorageInterface (line 6) | function StorageInterface() {}

FILE: dist/module/db/mongodb/index.js
  constant VERSION (line 2) | const defaults = {
  function sanitize (line 14) | function sanitize(str) {
  constant CLIENT (line 18) | let CLIENT,
  function MongoDB (line 27) | function MongoDB(name, config = {}) {
  function createCollection (line 57) | async function createCollection(db, ref, field) {
  function clear (line 133) | async function clear(ref) {
  function create_result (line 142) | function create_result(rows, resolve, enrich) {

FILE: dist/module/db/postgres/index.js
  constant VERSION (line 4) | const defaults = {
  constant MAXIMUM_QUERY_VARS (line 4) | const defaults = {
  function sanitize (line 39) | function sanitize(str) {
  constant TRX (line 43) | let DB, TRX;
  function PostgresDB (line 50) | function PostgresDB(name, config = {}) {
  function create_result (line 201) | function create_result(rows, resolve, enrich) {

FILE: dist/module/db/redis/index.js
  constant VERSION (line 5) | const VERSION = 1,
  constant TRX (line 14) | let DB, TRX;
  function sanitize (line 16) | function sanitize(str) {
  function RedisDB (line 24) | function RedisDB(name, config = {}) {
  function unlink (line 87) | function unlink(keys) {
  function create_result (line 93) | function create_result(range, type, resolve, enrich, resolution) {

FILE: dist/module/db/sqlite/index.js
  constant VERSION (line 7) | const VERSION = 1,
  constant MAXIMUM_QUERY_VARS (line 7) | const VERSION = 1,
  function sanitize (line 33) | function sanitize(str) {
  constant TRX (line 37) | const TRX = Object.create(null),
  function SqliteDB (line 46) | function SqliteDB(name, config = {}) {
  function create_result (line 224) | function create_result(rows, resolve, enrich) {
  function build_params (line 329) | function build_params(length, single_param) {

FILE: dist/module/document.js
  function Document (line 30) | function Document(options) {
  function parse_descriptor (line 221) | function parse_descriptor(options, document) {
  function parse_tree (line 304) | function parse_tree(key, marker) {

FILE: dist/module/document/add.js
  function store_value (line 170) | function store_value(obj, store, tree, pos, key, custom) {
  function add_index (line 196) | function add_index(obj, tree, marker, pos, index, id, key, _append) {

FILE: dist/module/document/highlight.js
  function highlight_fields (line 15) | function highlight_fields(query, result, index, pluck, config) {

FILE: dist/module/document/search.js
  function merge_fields (line 433) | function merge_fields(fields) {
  function get_tag (line 471) | function get_tag(tag, key, limit, offset, enrich) {
  function apply_enrich (line 496) | function apply_enrich(ids) {

FILE: dist/module/encoder.js
  function Encoder (line 58) | function Encoder(options = {}) {
  function fallback_encoder (line 442) | function fallback_encoder(str) {
  function clear (line 449) | function clear(self) {

FILE: dist/module/index.js
  function Index (line 31) | function Index(options, _register) {
  function autoCommit (line 112) | function autoCommit(self) {

FILE: dist/module/index/add.js
  function get_score (line 226) | function get_score(resolution, length, i, term_length, x) {

FILE: dist/module/index/remove.js
  function remove_index (line 59) | function remove_index(map, id) {

FILE: dist/module/index/search.js
  function return_result (line 199) | function return_result(result, resolution, limit, offset, suggest, boost...
  function single_term_query (line 228) | function single_term_query(term, keyword, limit, offset, resolve, enrich...
  function add_result (line 254) | function add_result(arr, result, suggest, resolution) {

FILE: dist/module/intersect.js
  function intersect (line 27) | function intersect(arrays, resolution, limit, offset, suggest, boost, re...
  function union (line 138) | function union(arrays, limit, offset, resolve, boost) {
  function intersect_union (line 215) | function intersect_union(arrays, mandatory, limit, offset, resolve) {

FILE: dist/module/keystore.js
  function _slice (line 3) | function _slice(self, start, end, splice) {
  function KeystoreArray (line 30) | function KeystoreArray(arr) {
  function Keystore (line 123) | function Keystore() {
  function KeystoreMap (line 141) | function KeystoreMap(bitlength = 8) {
  function KeystoreSet (line 196) | function KeystoreSet(bitlength = 8) {
  function lcg (line 313) | function lcg(str) {
  function lcg64 (line 332) | function lcg64(str) {

FILE: dist/module/preset.js
  function apply_preset (line 43) | function apply_preset(options) {

FILE: dist/module/profiler.js
  function tick (line 9) | function tick() {}

FILE: dist/module/resolve/and.js
  function return_result (line 39) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: dist/module/resolve/handler.js
  function inner_call (line 207) | function inner_call(query, method, index) {

FILE: dist/module/resolve/not.js
  function return_result (line 26) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusion (line 54) | function exclusion(result, limit, offset, resolve) {

FILE: dist/module/resolve/or.js
  function return_result (line 29) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: dist/module/resolve/xor.js
  function return_result (line 28) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusive (line 63) | function exclusive(result, limit, offset, resolve, boost) {

FILE: dist/module/resolver.js
  function Resolver (line 21) | function Resolver(result, index) {

FILE: dist/module/serialize.js
  function map_to_json (line 17) | function map_to_json(map, size = 0) {
  function json_to_map (line 40) | function json_to_map(json, map) {
  function ctx_to_json (line 55) | function ctx_to_json(ctx, size = 0) {
  function json_to_ctx (line 81) | function json_to_ctx(json, ctx) {
  function reg_to_json (line 100) | function reg_to_json(reg) {
  function json_to_reg (line 128) | function json_to_reg(json, reg) {
  function save (line 149) | function save(callback, field, key, chunk, index_doc, index_obj, index_p...
  function exportIndex (line 177) | function exportIndex(callback, _field, _index_doc = 0, _index_obj = 0) {
  function importIndex (line 221) | function importIndex(key, data) {
  function exportDocument (line 271) | function exportDocument(callback, _field, _index_doc = 0, _index_obj = 0) {
  function importDocument (line 331) | function importDocument(key, data) {
  function serialize (line 415) | function serialize(withFunctionWrapper = !0) {
  function parse_map (line 448) | function parse_map(map, type) {

FILE: dist/module/worker.js
  function WorkerIndex (line 17) | function WorkerIndex(options = /** @type IndexOptions */{}, encoder) {
  function register (line 106) | function register(key) {
  function create (line 143) | function create(factory, is_node_js, worker_path) {

FILE: index.d.ts
  type Id (line 18) | type Id = number | string;
  type Limit (line 19) | type Limit = number;
  type ExportHandler (line 20) | type ExportHandler = (key: string, data: string) => void;
  type ExportHandlerAsync (line 21) | type ExportHandlerAsync = (key: string, data: string) => Promise<void>;
  type AsyncCallback (line 22) | type AsyncCallback<T> = (result?: T) => void;
  type Preset (line 32) | type Preset =
  type Tokenizer (line 43) | type Tokenizer =
  type Encoders (line 53) | type Encoders =
  type ContextOptions (line 76) | type ContextOptions = {
  type SearchOptions (line 86) | type SearchOptions<R extends boolean = true> = {
  type SerializedFunctionString (line 97) | type SerializedFunctionString = string;
  type EncoderOptions (line 105) | type EncoderOptions = {
  type EncoderSplitOptions (line 125) | type EncoderSplitOptions = {
  type IndexOptions (line 165) | type IndexOptions<
  type DefaultSearchResults (line 200) | type DefaultSearchResults = Id[];
  type IntermediateSearchResults (line 201) | type IntermediateSearchResults = Array<Id[]>;
  type SearchResults (line 202) | type SearchResults<
  class Index (line 223) | class Index<
  type WorkerURL (line 375) | type WorkerURL = string;
  type WorkerPath (line 376) | type WorkerPath = string;
  type WorkerConfigURL (line 377) | type WorkerConfigURL = string;
  type WorkerConfigPath (line 378) | type WorkerConfigPath = string;
  type WorkerType (line 379) | type WorkerType = boolean | WorkerURL | WorkerPath;
  type WorkerIndexOptions (line 381) | type WorkerIndexOptions = IndexOptions & IndexWorkerConfig<true> & {
  type IndexWorkerConfig (line 390) | interface IndexWorkerConfig<W> {
  class Worker (line 396) | class Worker extends Promise<Index<true>> {
  type CustomFN (line 408) | type CustomFN<D = DocumentData> = (doc: D) => string | boolean;
  type TemplateResultHighlighting (line 413) | type TemplateResultHighlighting = string;
  type TagName (line 414) | type TagName = string;
  type FieldName (line 415) | type FieldName<D = DocumentData> = D extends object
  type DefaultFieldOptions (line 425) | type DefaultFieldOptions<
  type DefaultCustomFieldOptions (line 435) | type DefaultCustomFieldOptions<
  type TagOptions (line 446) | type TagOptions<
  type StoreOptions (line 453) | type StoreOptions<
  type FieldOptions (line 460) | type FieldOptions<
  type DocumentOptions (line 483) | type DocumentOptions<
  type DocumentDescriptor (line 497) | type DocumentDescriptor<
  type DefaultDocumentSearchResults (line 509) | type DefaultDocumentSearchResults<D extends DocumentData = DocumentData>...
  type EnrichedResults (line 515) | type EnrichedResults<D extends DocumentData = DocumentData> = Array<{
  type EnrichedDocumentSearchResults (line 521) | type EnrichedDocumentSearchResults<D extends DocumentData = DocumentData...
  type MergedDocumentSearchResults (line 527) | type MergedDocumentSearchResults<D extends DocumentData = DocumentData> ...
  type PluckOptions (line 536) | type PluckOptions<
  type DocumentSearchResults (line 543) | type DocumentSearchResults<
  type DocumentSearchResultsWrapper (line 562) | type DocumentSearchResultsWrapper<
  type DocumentSearchOptions (line 586) | type DocumentSearchOptions<
  type DocumentValue (line 603) | type DocumentValue =
  type DocumentData (line 610) | type DocumentData = {
  class Document (line 619) | class Document<
  type IdType (line 915) | type IdType =
  type PersistentOptions (line 937) | type PersistentOptions = {
  type DefaultResolve (line 943) | type DefaultResolve<
  type ResolverOptions (line 961) | type ResolverOptions<
  type HighlightBoundaryOptions (line 986) | type HighlightBoundaryOptions = {
  type HighlightEllipsisOptions (line 992) | type HighlightEllipsisOptions = {
  type HighlightOptions (line 997) | type HighlightOptions = TemplateResultHighlighting | {
  class Encoder (line 1005) | class Encoder {
  class Resolver (line 1023) | class Resolver<
  class StorageInterface (line 1082) | class StorageInterface<D extends DocumentData = DocumentData> {
  class IndexedDB (line 1099) | class IndexedDB extends StorageInterface {

FILE: src/async.js
  function tick (line 23) | function tick(){
  function register (line 32) | function register(key){

FILE: src/cache.js
  function searchCache (line 11) | function searchCache(query, limit, options){
  function CacheClass (line 74) | function CacheClass(limit){

FILE: src/charset.js
  constant CJK (line 19) | const CJK = charset_cjk;

FILE: src/charset/latin/soundex.js
  function soundex (line 28) | function soundex(stringToEncode){

FILE: src/common.js
  function merge_option (line 7) | function merge_option(value, default_value, merge_value){
  function inherit (line 67) | function inherit(target_value, default_value){
  function create_object (line 73) | function create_object(){
  function concat (line 77) | function concat(arrays){
  function sort_by_length_down (line 81) | function sort_by_length_down(a, b){
  function sort_by_length_up (line 85) | function sort_by_length_up(a, b){
  function is_array (line 89) | function is_array(val){
  function is_string (line 93) | function is_string(val){
  function is_object (line 97) | function is_object(val){
  function is_function (line 101) | function is_function(val){
  function toArray (line 111) | function toArray(val, stringify){
  function parse_simple (line 120) | function parse_simple(obj, tree){
  function get_max_len (line 132) | function get_max_len(arr){

FILE: src/compress.js
  function toRadix (line 9) | function toRadix(number, radix = 255) {
  function lcg (line 62) | function lcg(str) {
  function clear (line 75) | function clear(){

FILE: src/config.js
  constant RELEASE (line 2) | const RELEASE = "source";
  constant DEBUG (line 5) | const DEBUG = true;
  constant PROFILER (line 8) | const PROFILER = false;
  constant POLYFILL (line 11) | const POLYFILL = false;
  constant SUPPORT_WORKER (line 14) | const SUPPORT_WORKER = true;
  constant SUPPORT_ENCODER (line 17) | const SUPPORT_ENCODER = true;
  constant SUPPORT_CHARSET (line 20) | const SUPPORT_CHARSET = true;
  constant SUPPORT_CACHE (line 23) | const SUPPORT_CACHE = true;
  constant SUPPORT_ASYNC (line 26) | const SUPPORT_ASYNC = true;
  constant SUPPORT_STORE (line 29) | const SUPPORT_STORE = true;
  constant SUPPORT_SUGGESTION (line 32) | const SUPPORT_SUGGESTION = true;
  constant SUPPORT_SERIALIZE (line 35) | const SUPPORT_SERIALIZE = true;
  constant SUPPORT_DOCUMENT (line 38) | const SUPPORT_DOCUMENT = true;
  constant SUPPORT_TAGS (line 41) | const SUPPORT_TAGS = true;
  constant SUPPORT_PERSISTENT (line 44) | const SUPPORT_PERSISTENT = true;
  constant SUPPORT_KEYSTORE (line 47) | const SUPPORT_KEYSTORE = true;
  constant SUPPORT_COMPRESSION (line 50) | const SUPPORT_COMPRESSION = false;
  constant SUPPORT_RESOLVER (line 53) | const SUPPORT_RESOLVER = true;
  constant SUPPORT_HIGHLIGHTING (line 56) | const SUPPORT_HIGHLIGHTING = true;

FILE: src/db/clickhouse/index.js
  constant VERSION (line 21) | const VERSION = 1;
  function sanitize (line 46) | function sanitize(str) {
  function ClickhouseDB (line 57) | function ClickhouseDB(name, config = {}){
  function create_result (line 203) | function create_result(rows, resolve, enrich){

FILE: src/db/indexeddb/index.js
  constant VERSION (line 14) | const VERSION = 1;
  function sanitize (line 39) | function sanitize(str) {
  function IdxDB (line 52) | function IdxDB(name, config = {}){
  function handle (line 592) | function handle(cursor, ids, _tag){
  function promisfy (line 697) | function promisfy(req, callback){

FILE: src/db/interface.js
  function StorageInterface (line 6) | function StorageInterface(name, config){}

FILE: src/db/mongodb/index.js
  constant VERSION (line 8) | const VERSION = 1;
  function sanitize (line 13) | function sanitize(str) {
  constant CLIENT (line 17) | let CLIENT;
  function MongoDB (line 25) | function MongoDB(name, config = {}){
  function createCollection (line 59) | async function createCollection(db, ref, field){
  function clear (line 142) | async function clear(ref){
  function create_result (line 157) | function create_result(rows, resolve, enrich){

FILE: src/db/postgres/index.js
  constant VERSION (line 14) | const VERSION = 1;
  constant MAXIMUM_QUERY_VARS (line 15) | const MAXIMUM_QUERY_VARS = 16000;
  function sanitize (line 39) | function sanitize(str) {
  constant TRX (line 43) | let DB, TRX;
  function PostgresDB (line 50) | function PostgresDB(name, config = {}){
  function create_result (line 208) | function create_result(rows, resolve, enrich){

FILE: src/db/redis/index.js
  constant VERSION (line 5) | const VERSION = 1;
  constant TRX (line 13) | let DB, TRX;
  function sanitize (line 15) | function sanitize(str) {
  function RedisDB (line 23) | function RedisDB(name, config = {}){
  function unlink (line 96) | function unlink(keys){
  function create_result (line 112) | function create_result(range, type, resolve, enrich, resolution){

FILE: src/db/sqlite/index.js
  constant VERSION (line 7) | const VERSION = 1;
  constant MAXIMUM_QUERY_VARS (line 8) | const MAXIMUM_QUERY_VARS = 16000;
  function sanitize (line 32) | function sanitize(str) {
  constant TRX (line 37) | const TRX = Object.create(null);
  function SqliteDB (line 45) | function SqliteDB(name, config = {}){
  function create_result (line 229) | function create_result(rows, resolve, enrich){
  function build_params (line 340) | function build_params(length, single_param){

FILE: src/document.js
  function Document (line 54) | function Document(options){
  function parse_descriptor (line 287) | function parse_descriptor(options, document){
  function parse_tree (line 387) | function parse_tree(key, marker){

FILE: src/document/add.js
  function store_value (line 194) | function store_value(obj, store, tree, pos, key, custom){
  function add_index (line 224) | function add_index(obj, tree, marker, pos, index, id, key, _append){

FILE: src/document/highlight.js
  function highlight_fields (line 21) | function highlight_fields(query, result, index, pluck, config){

FILE: src/document/search.js
  function merge_fields (line 575) | function merge_fields(fields){
  function get_tag (line 615) | function get_tag(tag, key, limit, offset, enrich){
  function apply_enrich (line 642) | function apply_enrich(ids){

FILE: src/encoder.js
  function Encoder (line 71) | function Encoder(options = {}){
  function fallback_encoder (line 589) | function fallback_encoder(str){
  function clear (line 633) | function clear(self){

FILE: src/index.js
  function Index (line 54) | function Index(options, _register){
  function autoCommit (line 176) | function autoCommit(self/*, replace, append*/){

FILE: src/index/add.js
  function get_score (line 301) | function get_score(resolution, length, i, term_length, x){

FILE: src/index/remove.js
  function remove_index (line 124) | function remove_index(map, id){

FILE: src/index/search.js
  function return_result (line 260) | function return_result(result, resolution, limit, offset, suggest, boost...
  function single_term_query (line 306) | function single_term_query(term, keyword, limit, offset, resolve, enrich...
  function add_result (line 349) | function add_result(arr, result, suggest, resolution){

FILE: src/intersect.js
  function intersect (line 29) | function intersect(arrays, resolution, limit, offset, suggest, boost, re...
  function union (line 180) | function union(arrays, limit, offset, resolve, boost){
  function intersect_union (line 262) | function intersect_union(arrays, mandatory, limit, offset, resolve) {

FILE: src/keystore.js
  function _slice (line 3) | function _slice(self, start, end, splice){
  function KeystoreArray (line 32) | function KeystoreArray(arr){
  function Keystore (line 140) | function Keystore() {
  function KeystoreMap (line 158) | function KeystoreMap(bitlength = 8){
  function KeystoreSet (line 214) | function KeystoreSet(bitlength = 8){
  function lcg (line 406) | function lcg(str) {
  function lcg64 (line 427) | function lcg64(str) {

FILE: src/preset.js
  function apply_preset (line 45) | function apply_preset(options){

FILE: src/profiler.js
  function tick (line 17) | function tick(name){

FILE: src/resolve/and.js
  function return_result (line 44) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: src/resolve/handler.js
  function inner_call (line 278) | function inner_call(query, method, index){

FILE: src/resolve/not.js
  function return_result (line 31) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusion (line 69) | function exclusion(result, limit, offset, resolve){

FILE: src/resolve/or.js
  function return_result (line 34) | function return_result(final, limit, offset, enrich, resolve, suggest, h...

FILE: src/resolve/xor.js
  function return_result (line 33) | function return_result(final, limit, offset, enrich, resolve, suggest, h...
  function exclusive (line 79) | function exclusive(result, limit, offset, resolve, boost){

FILE: src/resolver.js
  function Resolver (line 35) | function Resolver(result, index){

FILE: src/serialize.js
  function map_to_json (line 23) | function map_to_json(map, size = 0){
  function json_to_map (line 45) | function json_to_map(json, map){
  function ctx_to_json (line 59) | function ctx_to_json(ctx, size = 0){
  function json_to_ctx (line 83) | function json_to_ctx(json, ctx){
  function reg_to_json (line 102) | function reg_to_json(reg){
  function json_to_reg (line 129) | function json_to_reg(json, reg){
  function save (line 149) | function save(callback, field, key, chunk, index_doc, index_obj, index_p...
  function exportIndex (line 201) | function exportIndex(callback, _field, _index_doc = 0, _index_obj = 0){
  function importIndex (line 253) | function importIndex(key, data){
  function exportDocument (line 306) | function exportDocument(callback, _field, _index_doc = 0, _index_obj = 0){
  function importDocument (line 382) | function importDocument(key, data){
  function serialize (line 473) | function serialize(withFunctionWrapper = true){
  function parse_map (line 507) | function parse_map(map, type){

FILE: src/worker.js
  function WorkerIndex (line 24) | function WorkerIndex(options = /** @type IndexOptions */ ({}), encoder){
  function register (line 136) | function register(key){
  function create (line 174) | function create(factory, is_node_js, worker_path){

FILE: task/babel.js
  function exec (line 131) | function exec(prompt, callback){

FILE: task/build.js
  function hashCode (line 482) | function hashCode(str) {
  function exec (line 492) | function exec(prompt, callback){

FILE: test/encoder.js
  function test_encoder (line 110) | function test_encoder(str){

FILE: test/issues.js
  class FlexSearchService (line 339) | class FlexSearchService {
    method constructor (line 340) | constructor(){
    method updateIndexWithDocuments (line 361) | updateIndexWithDocuments(documents) {
    method searchDocuments (line 369) | searchDocuments({ query, limit = 100, offset = 0 }) {

FILE: test/resolver.js
  function create (line 789) | function create(){
  function create (line 872) | function create(){
  function create (line 966) | function create(){

FILE: test/serialize.js
  function normalize_map (line 249) | function normalize_map(map){
  function normalize_ctx (line 256) | function normalize_ctx(ctx){

FILE: test/types.ts
  function test_index (line 24) | async function test_index() {
  function test_document (line 147) | async function test_document() {
  function test_persistent (line 311) | async function test_persistent() {
  function test_worker (line 490) | async function test_worker() {
Condensed preview — 434 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,010K chars).
[
  {
    "path": ".gitattributes",
    "chars": 206,
    "preview": "index.html -linguist-detectable\nbench/** -linguist-detectable\ndist/** -linguist-detectable\ndoc/** -linguist-detectable\nt"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 264,
    "preview": "# These are supported funding model platforms\n\ngithub: [ts-thomas]\nopen_collective: flexsearch\nliberapay: ts-thomas\npatr"
  },
  {
    "path": ".github/workflows/node.js.yml",
    "chars": 2059,
    "preview": "# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tes"
  },
  {
    "path": ".gitignore",
    "chars": 83,
    "preview": ".idea\n.nyc_output\n.db\n!*.keep\ncoverage\nperf\nnode_modules\nserver\ntmp\nlog\nissue\nnode\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 8438,
    "preview": "# Changelog\n\n### Current Version\n\n- Calling `index.clear()` on a persistent Index does not stack to the task queue by de"
  },
  {
    "path": "LICENSE",
    "chars": 11357,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 64382,
    "preview": "<!-- FlexSearch v0.8: [Overview and Migration Guide](doc/0.8.0.md) -->\nGetting instant help by the DeepWiki AI assistant"
  },
  {
    "path": "SECURITY.md",
    "chars": 493,
    "preview": "# Security Policy\n\n## Supported Versions\n\n| Version | Supported          |\n| ------- | ------------------ |\n| 0.8.x   | "
  },
  {
    "path": "demo/autocomplete.html",
    "chars": 8569,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n    <met"
  },
  {
    "path": "demo/data/gulliver.js",
    "chars": 572353,
    "preview": "export const text_queries = \"gulliver;great;country;time;people;little;master;took;feet;houyhnhnms\".split(\";\");\nexport c"
  },
  {
    "path": "demo/data/movies.js",
    "chars": 598812,
    "preview": "export default [\n  \"$ aka Dollars\",\n  \"$1,000 a Touchdown\",\n  \"$10 Raise\",\n  \"$10,000 Under a Pillow\",\n  \"$50,000 Reward"
  },
  {
    "path": "dist/db/clickhouse/index.cjs",
    "chars": 20545,
    "preview": "'use strict';\n\nvar clickhouse = require('clickhouse');\n\n/**\n * @param {*} value\n * @param {*} default_value\n * @param {*"
  },
  {
    "path": "dist/db/indexeddb/index.cjs",
    "chars": 17570,
    "preview": "'use strict';\n\n/**\r\n * @param {*} value\r\n * @param {*} default_value\r\n * @param {*=} merge_value\r\n * @return {*}\r\n */\r\n\r"
  },
  {
    "path": "dist/db/mongodb/index.cjs",
    "chars": 19005,
    "preview": "'use strict';\n\nvar mongodb = require('mongodb');\n\nconst defaults = {\r\n    host: \"localhost\",\r\n    port: \"27017\",\r\n    us"
  },
  {
    "path": "dist/db/postgres/index.cjs",
    "chars": 24914,
    "preview": "'use strict';\n\nvar pg_promise = require('pg-promise');\n\n/**\r\n * @param {*} value\r\n * @param {*} default_value\r\n * @param"
  },
  {
    "path": "dist/db/redis/index.cjs",
    "chars": 16780,
    "preview": "'use strict';\n\nvar redis = require('redis');\n\n/**\r\n * @param {*} value\r\n * @param {*} default_value\r\n * @param {*=} merg"
  },
  {
    "path": "dist/db/sqlite/index.cjs",
    "chars": 25615,
    "preview": "'use strict';\n\nvar sqlite3 = require('sqlite3');\nvar path = require('path');\n\n/**\r\n * @param {*} value\r\n * @param {*} de"
  },
  {
    "path": "dist/flexsearch.bundle.debug.js",
    "chars": 85730,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hoste"
  },
  {
    "path": "dist/flexsearch.bundle.module.debug.js",
    "chars": 85523,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Module/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n "
  },
  {
    "path": "dist/flexsearch.bundle.module.debug.mjs",
    "chars": 85523,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Module/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n "
  },
  {
    "path": "dist/flexsearch.bundle.module.min.mjs",
    "chars": 51241,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Module)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Host"
  },
  {
    "path": "dist/flexsearch.compact.debug.js",
    "chars": 48587,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hoste"
  },
  {
    "path": "dist/flexsearch.compact.module.debug.js",
    "chars": 48516,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hoste"
  },
  {
    "path": "dist/flexsearch.es5.debug.js",
    "chars": 111604,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (ES5/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted b"
  },
  {
    "path": "dist/flexsearch.light.debug.js",
    "chars": 19612,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Light/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted"
  },
  {
    "path": "dist/flexsearch.light.module.debug.js",
    "chars": 19559,
    "preview": "/**!\n * FlexSearch.js v0.8.214 (Bundle/Debug)\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hoste"
  },
  {
    "path": "dist/module/async.js",
    "chars": 1642,
    "preview": "\nimport Document from \"./document.js\";\nimport Index from \"./index.js\";\nimport WorkerIndex from \"./worker.js\";\n\nexport de"
  },
  {
    "path": "dist/module/bundle.js",
    "chars": 11720,
    "preview": "\nimport { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, FieldOptions, IndexOptions, Document"
  },
  {
    "path": "dist/module/cache.js",
    "chars": 2662,
    "preview": "import Index from \"./index.js\";\nimport { SearchOptions, DocumentSearchOptions } from \"./type.js\";\n\n/**\n * @param {string"
  },
  {
    "path": "dist/module/charset/cjk.js",
    "chars": 133,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {\n    split: \"\"\n\n};\nexport def"
  },
  {
    "path": "dist/module/charset/exact.js",
    "chars": 170,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {\n    normalize: !1,\n    numer"
  },
  {
    "path": "dist/module/charset/latin/advanced.js",
    "chars": 448,
    "preview": "import { EncoderOptions } from \"../../type.js\";\nimport { soundex } from \"./balance.js\";\n\nexport const matcher = new Map("
  },
  {
    "path": "dist/module/charset/latin/balance.js",
    "chars": 344,
    "preview": "import { EncoderOptions } from \"../../type.js\";\n\nexport const soundex = new Map([[\"b\", \"p\"], [\"v\", \"f\"], [\"w\", \"f\"], [\"z"
  },
  {
    "path": "dist/module/charset/latin/extra.js",
    "chars": 340,
    "preview": "import { EncoderOptions } from \"../../type.js\";\nimport { soundex } from \"./balance.js\";\nimport { matcher, replacer } fro"
  },
  {
    "path": "dist/module/charset/latin/soundex.js",
    "chars": 1142,
    "preview": "import { EncoderOptions } from \"../../type.js\";\n\n/** @type {EncoderOptions} */\nconst options = {\n\n    dedupe: !1,\n    in"
  },
  {
    "path": "dist/module/charset/normalize.js",
    "chars": 117,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {};\nexport default options;"
  },
  {
    "path": "dist/module/charset/polyfill.js",
    "chars": 2490,
    "preview": "export default [[\"ª\", \"a\"], [\"²\", \"2\"], [\"³\", \"3\"], [\"¹\", \"1\"], [\"º\", \"o\"], [\"¼\", \"1⁄4\"], [\"½\", \"1⁄2\"], [\"¾\", \"3⁄4\"], [\""
  },
  {
    "path": "dist/module/charset.js",
    "chars": 1277,
    "preview": "import charset_exact from \"./charset/exact.js\";\nimport charset_normalize from \"./charset/normalize.js\";\nimport charset_l"
  },
  {
    "path": "dist/module/common.js",
    "chars": 3393,
    "preview": "/**\n * @param {*} value\n * @param {*} default_value\n * @param {*=} merge_value\n * @return {*}\n */\nexport function merge_"
  },
  {
    "path": "dist/module/compress.js",
    "chars": 1189,
    "preview": "let table, timer;\n\nconst cache = new Map();\n\nfunction toRadix(number, radix = 255) {\n\n    if (!table) {\n        table = "
  },
  {
    "path": "dist/module/db/clickhouse/index.js",
    "chars": 18973,
    "preview": "import { ClickHouse } from \"clickhouse\";\nimport StorageInterface from \"../interface.js\";\nimport { concat, toArray } from"
  },
  {
    "path": "dist/module/db/indexeddb/index.js",
    "chars": 15134,
    "preview": "const VERSION = 1,\n      IndexedDB = \"undefined\" != typeof window && (window.indexedDB || window.mozIndexedDB || window."
  },
  {
    "path": "dist/module/db/interface.js",
    "chars": 1333,
    "preview": "\n\n/**\n * @interface\n */\nexport default function StorageInterface() {}\n\nStorageInterface.prototype.mount = async function"
  },
  {
    "path": "dist/module/db/mongodb/index.js",
    "chars": 16934,
    "preview": "import { MongoClient } from \"mongodb\";\nconst defaults = {\n    host: \"localhost\",\n    port: \"27017\",\n    user: null,\n    "
  },
  {
    "path": "dist/module/db/postgres/index.js",
    "chars": 20906,
    "preview": "import pg_promise from \"pg-promise\";\nimport StorageInterface from \"../interface.js\";\nimport { concat, toArray } from \".."
  },
  {
    "path": "dist/module/db/redis/index.js",
    "chars": 14343,
    "preview": "import { createClient } from \"redis\";\nimport StorageInterface from \"../interface.js\";\nimport { toArray } from \"../../com"
  },
  {
    "path": "dist/module/db/sqlite/index.js",
    "chars": 22839,
    "preview": "\nimport sqlite3 from \"sqlite3\";\nimport path from \"path\";\nimport StorageInterface from \"../interface.js\";\nimport { concat"
  },
  {
    "path": "dist/module/document/add.js",
    "chars": 6427,
    "preview": "\nimport { create_object, is_array, is_object, is_string, parse_simple } from \"../common.js\";\nimport { KeystoreArray } fr"
  },
  {
    "path": "dist/module/document/highlight.js",
    "chars": 18177,
    "preview": "\nimport { parse_simple } from \"../common.js\";\nimport Index from \"../index.js\";\nimport WorkerIndex from \"../worker.js\";\ni"
  },
  {
    "path": "dist/module/document/search.js",
    "chars": 15975,
    "preview": "\nimport { DocumentSearchOptions, DocumentSearchResults, EnrichedDocumentSearchResults, MergedDocumentSearchResults, Merg"
  },
  {
    "path": "dist/module/document.js",
    "chars": 12177,
    "preview": "/**!\n * FlexSearch.js\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted by Nextapps GmbH\n * ht"
  },
  {
    "path": "dist/module/encoder.js",
    "chars": 13510,
    "preview": "\nimport { create_object, merge_option } from \"./common.js\";\nimport normalize_polyfill from \"./charset/polyfill.js\";\nimpo"
  },
  {
    "path": "dist/module/index/add.js",
    "chars": 8268,
    "preview": "\nimport { create_object } from \"../common.js\";\nimport Index, { autoCommit } from \"../index.js\";\nimport default_compress "
  },
  {
    "path": "dist/module/index/remove.js",
    "chars": 2659,
    "preview": "\nimport { is_array } from \"../common.js\";\nimport Index, { autoCommit } from \"../index.js\";\nimport { KeystoreMap } from \""
  },
  {
    "path": "dist/module/index/search.js",
    "chars": 8797,
    "preview": "\n\nimport { SearchOptions, SearchResults, EnrichedSearchResults, IntermediateSearchResults } from \"../type.js\";\nimport { "
  },
  {
    "path": "dist/module/index.js",
    "chars": 5064,
    "preview": "/**!\n * FlexSearch.js\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted by Nextapps GmbH\n * ht"
  },
  {
    "path": "dist/module/intersect.js",
    "chars": 7649,
    "preview": "\nimport Resolver from \"./resolver.js\";\nimport { create_object, concat, sort_by_length_up, get_max_len } from \"./common.j"
  },
  {
    "path": "dist/module/keystore.js",
    "chars": 8545,
    "preview": "import { create_object } from \"./common.js\";\n\nfunction _slice(self, start, end, splice) {\n    let arr = [];\n    for (let"
  },
  {
    "path": "dist/module/lang/de.js",
    "chars": 2981,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * Filter are also known as \"stopwords\", they completely filter out wo"
  },
  {
    "path": "dist/module/lang/en.js",
    "chars": 3283,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * http://www.ranks.nl/stopwords\n * @type {Set<string>}\n */\nexport con"
  },
  {
    "path": "dist/module/lang/fr.js",
    "chars": 2502,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * http://www.ranks.nl/stopwords\n * http://snowball.tartarus.org/algor"
  },
  {
    "path": "dist/module/preset.js",
    "chars": 926,
    "preview": "\nimport { is_string } from \"./common.js\";\nimport { IndexOptions } from \"./type.js\";\n\n/**\n * @type {Object<string, IndexO"
  },
  {
    "path": "dist/module/profiler.js",
    "chars": 144,
    "preview": "\nimport { create_object } from \"./common.js\";\nconst data = create_object();\n\n/**\n * @param {!string} name\n */\n\nexport de"
  },
  {
    "path": "dist/module/resolve/and.js",
    "chars": 2376,
    "preview": "import Resolver from \"../resolver.js\";\nimport { get_max_len } from \"../common.js\";\nimport { intersect } from \"../interse"
  },
  {
    "path": "dist/module/resolve/default.js",
    "chars": 1899,
    "preview": "import { concat } from \"../common.js\";\nimport { IntermediateSearchResults, SearchResults, EnrichedSearchResults } from \""
  },
  {
    "path": "dist/module/resolve/handler.js",
    "chars": 7130,
    "preview": "\nimport Resolver from \"../resolver.js\";\nimport { ResolverOptions, SearchResults, EnrichedSearchResults, IntermediateSear"
  },
  {
    "path": "dist/module/resolve/not.js",
    "chars": 2443,
    "preview": "import Resolver from \"../resolver.js\";\nimport { SearchResults, EnrichedSearchResults, IntermediateSearchResults, Highlig"
  },
  {
    "path": "dist/module/resolve/or.js",
    "chars": 1323,
    "preview": "import Resolver from \"../resolver.js\";\nimport { union } from \"../intersect.js\";\nimport { SearchResults, EnrichedSearchRe"
  },
  {
    "path": "dist/module/resolve/xor.js",
    "chars": 3450,
    "preview": "import Resolver from \"../resolver.js\";\nimport { create_object } from \"../common.js\";\nimport { SearchResults, EnrichedSea"
  },
  {
    "path": "dist/module/resolver.js",
    "chars": 7586,
    "preview": "\nimport { ResolverOptions, IntermediateSearchResults, SearchResults, EnrichedSearchResults, HighlightOptions } from \"./t"
  },
  {
    "path": "dist/module/serialize.js",
    "chars": 11318,
    "preview": "\nimport Index from \"./index.js\";\nimport Document from \"./document.js\";\nimport { KeystoreMap, KeystoreSet } from \"./keyst"
  },
  {
    "path": "dist/module/type.js",
    "chars": 8332,
    "preview": "\n\nimport Index from \"./index.js\";\nimport Document from \"./document.js\";\nimport WorkerIndex from \"./worker.js\";\nimport En"
  },
  {
    "path": "dist/module/worker/handler.js",
    "chars": 1920,
    "preview": "\nimport Index from \"../index.js\";\nimport { IndexOptions } from \"../type.js\";\n\n/** @type Index */\nlet index, options;\n/**"
  },
  {
    "path": "dist/module/worker/node.js",
    "chars": 2351,
    "preview": "/*\n * Node.js Worker (CommonJS)\n * This file is a standalone file and isn't being a part of the build/bundle\n */\nconst {"
  },
  {
    "path": "dist/module/worker/worker.js",
    "chars": 56,
    "preview": "import handler from \"./handler.js\";\nonmessage = handler;"
  },
  {
    "path": "dist/module/worker.js",
    "chars": 4128,
    "preview": "\nimport { IndexOptions } from \"./type.js\";\nimport { create_object } from \"./common.js\";\nimport { searchCache } from \"./c"
  },
  {
    "path": "dist/module-debug/async.js",
    "chars": 1642,
    "preview": "\nimport Document from \"./document.js\";\nimport Index from \"./index.js\";\nimport WorkerIndex from \"./worker.js\";\n\nexport de"
  },
  {
    "path": "dist/module-debug/bundle.js",
    "chars": 11720,
    "preview": "\nimport { SearchOptions, ContextOptions, DocumentDescriptor, DocumentSearchOptions, FieldOptions, IndexOptions, Document"
  },
  {
    "path": "dist/module-debug/cache.js",
    "chars": 2662,
    "preview": "import Index from \"./index.js\";\nimport { SearchOptions, DocumentSearchOptions } from \"./type.js\";\n\n/**\n * @param {string"
  },
  {
    "path": "dist/module-debug/charset/cjk.js",
    "chars": 133,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {\n    split: \"\"\n\n};\nexport def"
  },
  {
    "path": "dist/module-debug/charset/exact.js",
    "chars": 170,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {\n    normalize: !1,\n    numer"
  },
  {
    "path": "dist/module-debug/charset/latin/advanced.js",
    "chars": 448,
    "preview": "import { EncoderOptions } from \"../../type.js\";\nimport { soundex } from \"./balance.js\";\n\nexport const matcher = new Map("
  },
  {
    "path": "dist/module-debug/charset/latin/balance.js",
    "chars": 344,
    "preview": "import { EncoderOptions } from \"../../type.js\";\n\nexport const soundex = new Map([[\"b\", \"p\"], [\"v\", \"f\"], [\"w\", \"f\"], [\"z"
  },
  {
    "path": "dist/module-debug/charset/latin/extra.js",
    "chars": 340,
    "preview": "import { EncoderOptions } from \"../../type.js\";\nimport { soundex } from \"./balance.js\";\nimport { matcher, replacer } fro"
  },
  {
    "path": "dist/module-debug/charset/latin/soundex.js",
    "chars": 1142,
    "preview": "import { EncoderOptions } from \"../../type.js\";\n\n/** @type {EncoderOptions} */\nconst options = {\n\n    dedupe: !1,\n    in"
  },
  {
    "path": "dist/module-debug/charset/normalize.js",
    "chars": 117,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/** @type EncoderOptions */\nconst options = {};\nexport default options;"
  },
  {
    "path": "dist/module-debug/charset/polyfill.js",
    "chars": 2490,
    "preview": "export default [[\"ª\", \"a\"], [\"²\", \"2\"], [\"³\", \"3\"], [\"¹\", \"1\"], [\"º\", \"o\"], [\"¼\", \"1⁄4\"], [\"½\", \"1⁄2\"], [\"¾\", \"3⁄4\"], [\""
  },
  {
    "path": "dist/module-debug/charset.js",
    "chars": 1277,
    "preview": "import charset_exact from \"./charset/exact.js\";\nimport charset_normalize from \"./charset/normalize.js\";\nimport charset_l"
  },
  {
    "path": "dist/module-debug/common.js",
    "chars": 3393,
    "preview": "/**\n * @param {*} value\n * @param {*} default_value\n * @param {*=} merge_value\n * @return {*}\n */\nexport function merge_"
  },
  {
    "path": "dist/module-debug/compress.js",
    "chars": 1189,
    "preview": "let table, timer;\n\nconst cache = new Map();\n\nfunction toRadix(number, radix = 255) {\n\n    if (!table) {\n        table = "
  },
  {
    "path": "dist/module-debug/db/clickhouse/index.js",
    "chars": 18973,
    "preview": "import { ClickHouse } from \"clickhouse\";\nimport StorageInterface from \"../interface.js\";\nimport { concat, toArray } from"
  },
  {
    "path": "dist/module-debug/db/indexeddb/index.js",
    "chars": 15134,
    "preview": "const VERSION = 1,\n      IndexedDB = \"undefined\" != typeof window && (window.indexedDB || window.mozIndexedDB || window."
  },
  {
    "path": "dist/module-debug/db/interface.js",
    "chars": 1333,
    "preview": "\n\n/**\n * @interface\n */\nexport default function StorageInterface() {}\n\nStorageInterface.prototype.mount = async function"
  },
  {
    "path": "dist/module-debug/db/mongodb/index.js",
    "chars": 16934,
    "preview": "import { MongoClient } from \"mongodb\";\nconst defaults = {\n    host: \"localhost\",\n    port: \"27017\",\n    user: null,\n    "
  },
  {
    "path": "dist/module-debug/db/postgres/index.js",
    "chars": 20906,
    "preview": "import pg_promise from \"pg-promise\";\nimport StorageInterface from \"../interface.js\";\nimport { concat, toArray } from \".."
  },
  {
    "path": "dist/module-debug/db/redis/index.js",
    "chars": 14343,
    "preview": "import { createClient } from \"redis\";\nimport StorageInterface from \"../interface.js\";\nimport { toArray } from \"../../com"
  },
  {
    "path": "dist/module-debug/db/sqlite/index.js",
    "chars": 22839,
    "preview": "\nimport sqlite3 from \"sqlite3\";\nimport path from \"path\";\nimport StorageInterface from \"../interface.js\";\nimport { concat"
  },
  {
    "path": "dist/module-debug/document/add.js",
    "chars": 6505,
    "preview": "\nimport { create_object, is_array, is_object, is_string, parse_simple } from \"../common.js\";\nimport { KeystoreArray } fr"
  },
  {
    "path": "dist/module-debug/document/highlight.js",
    "chars": 18463,
    "preview": "\nimport { parse_simple } from \"../common.js\";\nimport Index from \"../index.js\";\nimport WorkerIndex from \"../worker.js\";\ni"
  },
  {
    "path": "dist/module-debug/document/search.js",
    "chars": 17371,
    "preview": "\nimport { DocumentSearchOptions, DocumentSearchResults, EnrichedDocumentSearchResults, MergedDocumentSearchResults, Merg"
  },
  {
    "path": "dist/module-debug/document.js",
    "chars": 12395,
    "preview": "/**!\n * FlexSearch.js\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted by Nextapps GmbH\n * ht"
  },
  {
    "path": "dist/module-debug/encoder.js",
    "chars": 13822,
    "preview": "\nimport { create_object, merge_option } from \"./common.js\";\nimport normalize_polyfill from \"./charset/polyfill.js\";\nimpo"
  },
  {
    "path": "dist/module-debug/index/add.js",
    "chars": 8268,
    "preview": "\nimport { create_object } from \"../common.js\";\nimport Index, { autoCommit } from \"../index.js\";\nimport default_compress "
  },
  {
    "path": "dist/module-debug/index/remove.js",
    "chars": 2659,
    "preview": "\nimport { is_array } from \"../common.js\";\nimport Index, { autoCommit } from \"../index.js\";\nimport { KeystoreMap } from \""
  },
  {
    "path": "dist/module-debug/index/search.js",
    "chars": 8797,
    "preview": "\n\nimport { SearchOptions, SearchResults, EnrichedSearchResults, IntermediateSearchResults } from \"../type.js\";\nimport { "
  },
  {
    "path": "dist/module-debug/index.js",
    "chars": 5352,
    "preview": "/**!\n * FlexSearch.js\n * Author and Copyright: Thomas Wilkerling\n * Licence: Apache-2.0\n * Hosted by Nextapps GmbH\n * ht"
  },
  {
    "path": "dist/module-debug/intersect.js",
    "chars": 7649,
    "preview": "\nimport Resolver from \"./resolver.js\";\nimport { create_object, concat, sort_by_length_up, get_max_len } from \"./common.j"
  },
  {
    "path": "dist/module-debug/keystore.js",
    "chars": 8545,
    "preview": "import { create_object } from \"./common.js\";\n\nfunction _slice(self, start, end, splice) {\n    let arr = [];\n    for (let"
  },
  {
    "path": "dist/module-debug/lang/de.js",
    "chars": 2981,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * Filter are also known as \"stopwords\", they completely filter out wo"
  },
  {
    "path": "dist/module-debug/lang/en.js",
    "chars": 3283,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * http://www.ranks.nl/stopwords\n * @type {Set<string>}\n */\nexport con"
  },
  {
    "path": "dist/module-debug/lang/fr.js",
    "chars": 2502,
    "preview": "import { EncoderOptions } from \"../type.js\";\n\n/**\n * http://www.ranks.nl/stopwords\n * http://snowball.tartarus.org/algor"
  },
  {
    "path": "dist/module-debug/preset.js",
    "chars": 1025,
    "preview": "\nimport { is_string } from \"./common.js\";\nimport { IndexOptions } from \"./type.js\";\n\n/**\n * @type {Object<string, IndexO"
  },
  {
    "path": "dist/module-debug/profiler.js",
    "chars": 144,
    "preview": "\nimport { create_object } from \"./common.js\";\nconst data = create_object();\n\n/**\n * @param {!string} name\n */\n\nexport de"
  },
  {
    "path": "dist/module-debug/resolve/and.js",
    "chars": 2376,
    "preview": "import Resolver from \"../resolver.js\";\nimport { get_max_len } from \"../common.js\";\nimport { intersect } from \"../interse"
  },
  {
    "path": "dist/module-debug/resolve/default.js",
    "chars": 1899,
    "preview": "import { concat } from \"../common.js\";\nimport { IntermediateSearchResults, SearchResults, EnrichedSearchResults } from \""
  },
  {
    "path": "dist/module-debug/resolve/handler.js",
    "chars": 7728,
    "preview": "\nimport Resolver from \"../resolver.js\";\nimport { ResolverOptions, SearchResults, EnrichedSearchResults, IntermediateSear"
  },
  {
    "path": "dist/module-debug/resolve/not.js",
    "chars": 2443,
    "preview": "import Resolver from \"../resolver.js\";\nimport { SearchResults, EnrichedSearchResults, IntermediateSearchResults, Highlig"
  },
  {
    "path": "dist/module-debug/resolve/or.js",
    "chars": 1323,
    "preview": "import Resolver from \"../resolver.js\";\nimport { union } from \"../intersect.js\";\nimport { SearchResults, EnrichedSearchRe"
  },
  {
    "path": "dist/module-debug/resolve/xor.js",
    "chars": 3450,
    "preview": "import Resolver from \"../resolver.js\";\nimport { create_object } from \"../common.js\";\nimport { SearchResults, EnrichedSea"
  },
  {
    "path": "dist/module-debug/resolver.js",
    "chars": 7799,
    "preview": "\nimport { ResolverOptions, IntermediateSearchResults, SearchResults, EnrichedSearchResults, HighlightOptions } from \"./t"
  },
  {
    "path": "dist/module-debug/serialize.js",
    "chars": 11318,
    "preview": "\nimport Index from \"./index.js\";\nimport Document from \"./document.js\";\nimport { KeystoreMap, KeystoreSet } from \"./keyst"
  },
  {
    "path": "dist/module-debug/type.js",
    "chars": 8332,
    "preview": "\n\nimport Index from \"./index.js\";\nimport Document from \"./document.js\";\nimport WorkerIndex from \"./worker.js\";\nimport En"
  },
  {
    "path": "dist/module-debug/worker/handler.js",
    "chars": 2436,
    "preview": "\nimport Index from \"../index.js\";\nimport { IndexOptions } from \"../type.js\";\n\n/** @type Index */\nlet index, options;\n/**"
  },
  {
    "path": "dist/module-debug/worker/node.js",
    "chars": 2351,
    "preview": "/*\n * Node.js Worker (CommonJS)\n * This file is a standalone file and isn't being a part of the build/bundle\n */\nconst {"
  },
  {
    "path": "dist/module-debug/worker/worker.js",
    "chars": 56,
    "preview": "import handler from \"./handler.js\";\nonmessage = handler;"
  },
  {
    "path": "dist/module-debug/worker.js",
    "chars": 4274,
    "preview": "\nimport { IndexOptions } from \"./type.js\";\nimport { create_object } from \"./common.js\";\nimport { searchCache } from \"./c"
  },
  {
    "path": "dist/module-min/async.js",
    "chars": 817,
    "preview": "import Document from\"./document.js\";import Index from\"./index.js\";import WorkerIndex from\"./worker.js\";export default fu"
  },
  {
    "path": "dist/module-min/bundle.js",
    "chars": 7405,
    "preview": "import{SearchOptions,ContextOptions,DocumentDescriptor,DocumentSearchOptions,FieldOptions,IndexOptions,DocumentOptions,T"
  },
  {
    "path": "dist/module-min/cache.js",
    "chars": 1146,
    "preview": "import Index from\"./index.js\";import{SearchOptions,DocumentSearchOptions}from\"./type.js\";export function searchCache(a,b"
  },
  {
    "path": "dist/module-min/charset/cjk.js",
    "chars": 87,
    "preview": "import{EncoderOptions}from\"../type.js\";const options={split:\"\"};export default options;"
  },
  {
    "path": "dist/module-min/charset/exact.js",
    "chars": 112,
    "preview": "import{EncoderOptions}from\"../type.js\";const options={normalize:!1,numeric:!1,dedupe:!1};export default options;"
  },
  {
    "path": "dist/module-min/charset/latin/advanced.js",
    "chars": 364,
    "preview": "import{EncoderOptions}from\"../../type.js\";import{soundex}from\"./balance.js\";export const matcher=new Map([[\"ae\",\"a\"],[\"o"
  },
  {
    "path": "dist/module-min/charset/latin/balance.js",
    "chars": 268,
    "preview": "import{EncoderOptions}from\"../../type.js\";export const soundex=new Map([[\"b\",\"p\"],[\"v\",\"f\"],[\"w\",\"f\"],[\"z\",\"s\"],[\"x\",\"s\""
  },
  {
    "path": "dist/module-min/charset/latin/extra.js",
    "chars": 264,
    "preview": "import{EncoderOptions}from\"../../type.js\";import{soundex}from\"./balance.js\";import{matcher,replacer}from\"./advanced.js\";"
  },
  {
    "path": "dist/module-min/charset/latin/soundex.js",
    "chars": 472,
    "preview": "import{EncoderOptions}from\"../../type.js\";const options={dedupe:!1,include:{letter:!0},finalize:function(a){for(let b=0;"
  },
  {
    "path": "dist/module-min/charset/normalize.js",
    "chars": 79,
    "preview": "import{EncoderOptions}from\"../type.js\";const options={};export default options;"
  },
  {
    "path": "dist/module-min/charset/polyfill.js",
    "chars": 3316,
    "preview": "export default[[\"\\xAA\",\"a\"],[\"\\xB2\",\"2\"],[\"\\xB3\",\"3\"],[\"\\xB9\",\"1\"],[\"\\xBA\",\"o\"],[\"\\xBC\",\"1\\u20444\"],[\"\\xBD\",\"1\\u20442\"],"
  },
  {
    "path": "dist/module-min/charset.js",
    "chars": 1175,
    "preview": "import charset_exact from\"./charset/exact.js\";import charset_normalize from\"./charset/normalize.js\";import charset_latin"
  },
  {
    "path": "dist/module-min/common.js",
    "chars": 1295,
    "preview": "export function merge_option(a,b,c){const d=typeof c,e=typeof a;if(\"undefined\"!=d){if(\"undefined\"!=e){if(c){if(\"function"
  },
  {
    "path": "dist/module-min/compress.js",
    "chars": 628,
    "preview": "let table,timer;const cache=new Map;function toRadix(a,b=255){if(!table){table=Array(b);for(let a=0;a<b;a++)table[a]=a+1"
  },
  {
    "path": "dist/module-min/db/clickhouse/index.js",
    "chars": 12345,
    "preview": "import{ClickHouse}from\"clickhouse\";import StorageInterface from\"../interface.js\";import{concat,toArray}from\"../../common"
  },
  {
    "path": "dist/module-min/db/indexeddb/index.js",
    "chars": 6427,
    "preview": "const VERSION=1,IndexedDB=\"undefined\"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||wi"
  },
  {
    "path": "dist/module-min/db/interface.js",
    "chars": 662,
    "preview": "export default function StorageInterface(){}StorageInterface.prototype.mount=async function(){},StorageInterface.prototy"
  },
  {
    "path": "dist/module-min/db/mongodb/index.js",
    "chars": 8467,
    "preview": "import{MongoClient}from\"mongodb\";const defaults={host:\"localhost\",port:\"27017\",user:null,pass:null},VERSION=1,fields=[\"m"
  },
  {
    "path": "dist/module-min/db/postgres/index.js",
    "chars": 12941,
    "preview": "import pg_promise from\"pg-promise\";import StorageInterface from\"../interface.js\";import{concat,toArray}from\"../../common"
  },
  {
    "path": "dist/module-min/db/redis/index.js",
    "chars": 7048,
    "preview": "import{createClient}from\"redis\";import StorageInterface from\"../interface.js\";import{toArray}from\"../../common.js\";const"
  },
  {
    "path": "dist/module-min/db/sqlite/index.js",
    "chars": 13902,
    "preview": "import sqlite3 from\"sqlite3\";import path from\"path\";import StorageInterface from\"../interface.js\";import{concat,toArray}"
  },
  {
    "path": "dist/module-min/document/add.js",
    "chars": 2223,
    "preview": "import{create_object,is_array,is_object,is_string,parse_simple}from\"../common.js\";import{KeystoreArray}from\"../keystore."
  },
  {
    "path": "dist/module-min/document/highlight.js",
    "chars": 3520,
    "preview": "import{parse_simple}from\"../common.js\";import Index from\"../index.js\";import WorkerIndex from\"../worker.js\";import{Enric"
  },
  {
    "path": "dist/module-min/document/search.js",
    "chars": 4985,
    "preview": "import{DocumentSearchOptions,DocumentSearchResults,EnrichedDocumentSearchResults,MergedDocumentSearchResults,MergedDocum"
  },
  {
    "path": "dist/module-min/document.js",
    "chars": 5551,
    "preview": "import{IndexOptions,DocumentOptions,DocumentDescriptor,FieldOptions,StoreOptions,EncoderOptions}from\"./type.js\";import S"
  },
  {
    "path": "dist/module-min/encoder.js",
    "chars": 6056,
    "preview": "import{create_object,merge_option}from\"./common.js\";import normalize_polyfill from\"./charset/polyfill.js\";import{Encoder"
  },
  {
    "path": "dist/module-min/index/add.js",
    "chars": 2666,
    "preview": "import{create_object}from\"../common.js\";import Index,{autoCommit}from\"../index.js\";import default_compress from\"../compr"
  },
  {
    "path": "dist/module-min/index/remove.js",
    "chars": 963,
    "preview": "import{is_array}from\"../common.js\";import Index,{autoCommit}from\"../index.js\";import{KeystoreMap}from\"../keystore.js\";In"
  },
  {
    "path": "dist/module-min/index/search.js",
    "chars": 2629,
    "preview": "import{SearchOptions,SearchResults,EnrichedSearchResults,IntermediateSearchResults}from\"../type.js\";import{create_object"
  },
  {
    "path": "dist/module-min/index.js",
    "chars": 3000,
    "preview": "import{IndexOptions,ContextOptions,EncoderOptions}from\"./type.js\";import Encoder,{fallback_encoder}from\"./encoder.js\";im"
  },
  {
    "path": "dist/module-min/intersect.js",
    "chars": 1800,
    "preview": "import Resolver from\"./resolver.js\";import{create_object,concat,sort_by_length_up,get_max_len}from\"./common.js\";import{S"
  },
  {
    "path": "dist/module-min/keystore.js",
    "chars": 3628,
    "preview": "import{create_object}from\"./common.js\";function _slice(a,b,c,d){let e=[];for(let f,g=0;g<a.index.length;g++)if(f=a.index"
  },
  {
    "path": "dist/module-min/lang/de.js",
    "chars": 1629,
    "preview": "import{EncoderOptions}from\"../type.js\";export const filter=new Set([\"aber\",\"als\",\"am\",\"an\",\"auch\",\"auf\",\"aus\",\"bei\",\"bin"
  },
  {
    "path": "dist/module-min/lang/en.js",
    "chars": 2514,
    "preview": "import{EncoderOptions}from\"../type.js\";export const filter=new Set([\"a\",\"about\",\"above\",\"after\",\"again\",\"against\",\"all\","
  },
  {
    "path": "dist/module-min/lang/fr.js",
    "chars": 2030,
    "preview": "import{EncoderOptions}from\"../type.js\";export const filter=new Set([\"au\",\"aux\",\"avec\",\"ce\",\"ces\",\"dans\",\"de\",\"des\",\"du\","
  },
  {
    "path": "dist/module-min/preset.js",
    "chars": 379,
    "preview": "import{is_string}from\"./common.js\";import{IndexOptions}from\"./type.js\";const presets={memory:{resolution:1},performance:"
  },
  {
    "path": "dist/module-min/profiler.js",
    "chars": 98,
    "preview": "import{create_object}from\"./common.js\";const data=create_object();export default function tick(){}"
  },
  {
    "path": "dist/module-min/resolve/and.js",
    "chars": 746,
    "preview": "import Resolver from\"../resolver.js\";import{get_max_len}from\"../common.js\";import{intersect}from\"../intersect.js\";import"
  },
  {
    "path": "dist/module-min/resolve/default.js",
    "chars": 728,
    "preview": "import{concat}from\"../common.js\";import{IntermediateSearchResults,SearchResults,EnrichedSearchResults}from\"../type.js\";i"
  },
  {
    "path": "dist/module-min/resolve/handler.js",
    "chars": 2213,
    "preview": "import Resolver from\"../resolver.js\";import{ResolverOptions,SearchResults,EnrichedSearchResults,IntermediateSearchResult"
  },
  {
    "path": "dist/module-min/resolve/not.js",
    "chars": 765,
    "preview": "import Resolver from\"../resolver.js\";import{SearchResults,EnrichedSearchResults,IntermediateSearchResults,HighlightOptio"
  },
  {
    "path": "dist/module-min/resolve/or.js",
    "chars": 482,
    "preview": "import Resolver from\"../resolver.js\";import{union}from\"../intersect.js\";import{SearchResults,EnrichedSearchResults,Inter"
  },
  {
    "path": "dist/module-min/resolve/xor.js",
    "chars": 1028,
    "preview": "import Resolver from\"../resolver.js\";import{create_object}from\"../common.js\";import{SearchResults,EnrichedSearchResults,"
  },
  {
    "path": "dist/module-min/resolver.js",
    "chars": 3132,
    "preview": "import{ResolverOptions,IntermediateSearchResults,SearchResults,EnrichedSearchResults,HighlightOptions}from\"./type.js\";im"
  },
  {
    "path": "dist/module-min/serialize.js",
    "chars": 4046,
    "preview": "import Index from\"./index.js\";import Document from\"./document.js\";import{KeystoreMap,KeystoreSet}from\"./keystore.js\";imp"
  },
  {
    "path": "dist/module-min/type.js",
    "chars": 947,
    "preview": "import Index from\"./index.js\";import Document from\"./document.js\";import WorkerIndex from\"./worker.js\";import Encoder fr"
  },
  {
    "path": "dist/module-min/worker/handler.js",
    "chars": 759,
    "preview": "import Index from\"../index.js\";import{IndexOptions}from\"../type.js\";let index,options;export default(async function(a){a"
  },
  {
    "path": "dist/module-min/worker/node.js",
    "chars": 1113,
    "preview": "const{parentPort}=require(\"worker_threads\"),{Index}=require(\"flexsearch\");let index,options;parentPort.on(\"message\",asyn"
  },
  {
    "path": "dist/module-min/worker/worker.js",
    "chars": 52,
    "preview": "import handler from\"./handler.js\";onmessage=handler;"
  },
  {
    "path": "dist/module-min/worker.js",
    "chars": 2281,
    "preview": "import{IndexOptions}from\"./type.js\";import{create_object}from\"./common.js\";import{searchCache}from\"./cache.js\";import ha"
  },
  {
    "path": "doc/async.md",
    "chars": 2504,
    "preview": "## Asynchronous Runtime Balancer\n\n> The async processing model is automatically observed by a runtime balancer to preven"
  },
  {
    "path": "doc/custom-builds.md",
    "chars": 4936,
    "preview": "## Custom Builds\n\nThe `/src/` folder of this repository requires some compilation to resolve the build flags.\n\n<!--\nThos"
  },
  {
    "path": "doc/customization.md",
    "chars": 1776,
    "preview": "## Custom Score Function\n\n```js\nconst index = new FlexSearchIndex({\n    resolution: 10,\n    score: function(content, ter"
  },
  {
    "path": "doc/document-search.md",
    "chars": 26710,
    "preview": "# Document Search (Field-Search)\n\nWhereas the simple `Index` can just consume id-content pairs, the `Document`-Index is "
  },
  {
    "path": "doc/encoder.md",
    "chars": 20281,
    "preview": "## Encoder\n\n> [!IMPORTANT]\n> You shouldn't miss this part as it is one of the most important aspects of FlexSearch.\n\nSea"
  },
  {
    "path": "doc/export-import.md",
    "chars": 5682,
    "preview": "## Import / Export (In-Memory)\n\n> Persistent-Indexes and Worker-Indexes don't support Import/Export.\n\nExport an `Index` "
  },
  {
    "path": "doc/keystore.md",
    "chars": 861,
    "preview": "## Big In-Memory Keystores\n\nThe default maximum keystore limit for the In-Memory index is 2^24 of distinct terms/partial"
  },
  {
    "path": "doc/persistent-clickhouse.md",
    "chars": 3403,
    "preview": "# Clickhouse FlexSearch\n\nClickhouse is highly optimized for raw I/O and write access. When your index needs to be freque"
  },
  {
    "path": "doc/persistent-indexeddb.md",
    "chars": 1525,
    "preview": "# IndexedDB FlexSearch\n\nIndexedDB is a persistent storage supported by all major browsers.\n\nCreate an index and assign a"
  },
  {
    "path": "doc/persistent-mongodb.md",
    "chars": 2272,
    "preview": "# MongoDB FlexSearch\n\nMongoDB is a common NoSQL document store providing everything you might want from a solid FlexSear"
  },
  {
    "path": "doc/persistent-postgres.md",
    "chars": 3340,
    "preview": "# PostgreSQL FlexSearch\n\nPostgres is widely used as the default database engine. It can hold large amounts of data and a"
  },
  {
    "path": "doc/persistent-redis.md",
    "chars": 2862,
    "preview": "# Redis FlexSearch\n\nRedis is a standard storage engine in almost every modern application stack. It combines the advanta"
  },
  {
    "path": "doc/persistent-sqlite.md",
    "chars": 3126,
    "preview": "# SQLite FlexSearch\n\nSQLite offers you a compact and resource-friendly database which stores right into a portable db fi"
  },
  {
    "path": "doc/persistent.md",
    "chars": 8422,
    "preview": "# Persistent Indexes\n\nFlexSearch provides a new Storage Adapter where indexes are delegated through persistent storages."
  },
  {
    "path": "doc/resolver.md",
    "chars": 10424,
    "preview": "## Resolver (Complex Queries)\n\nRetrieve an unresolved result:\n\n```js\nconst raw = index.search(\"a short query\", { \n    re"
  },
  {
    "path": "doc/result-highlighting.md",
    "chars": 7928,
    "preview": "## Result Highlighting\n\nDemo: <a href=\"https://raw.githack.com/nextapps-de/flexsearch/master/demo/autocomplete.html\" tar"
  },
  {
    "path": "doc/worker.md",
    "chars": 12603,
    "preview": "# Worker Parallelism (Browser + Node.js)\n\n### Worker Index\n\nUsing a Worker-Index is pretty much the same as using a stan"
  },
  {
    "path": "docker-compose.yml",
    "chars": 1096,
    "preview": "version: \"3.6\"\nservices:\n  postgres:\n    image: postgres:latest\n    restart: on-failure\n    volumes:\n      - pg-data:/va"
  },
  {
    "path": "example/browser-legacy/basic/index.html",
    "chars": 1238,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  },
  {
    "path": "example/browser-legacy/basic-persistent/index.html",
    "chars": 1441,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  },
  {
    "path": "example/browser-legacy/basic-resolver/index.html",
    "chars": 1379,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  },
  {
    "path": "example/browser-legacy/basic-suggestion/index.html",
    "chars": 1183,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  },
  {
    "path": "example/browser-legacy/basic-worker/index.html",
    "chars": 1187,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  },
  {
    "path": "example/browser-legacy/document/index.html",
    "chars": 2910,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, he"
  }
]

// ... and 234 more files (download for full content)

About this extraction

This page contains the full source code of the nextapps-de/flexsearch GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 434 files (3.6 MB), approximately 963.2k tokens, and a symbol index with 1035 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!