# epstein

> Fast in-memory search engine written in Javascript

Latest version **0.1.2** (published 2019-12-08) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install epstein
pnpm add epstein
yarn add epstein
bun add epstein
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-12-08 |
| First published | 2019-10-22 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 193.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | alexhoma |
| Maintainers | alexhoma |
| Keywords | search, javascript, es6, search-engine, the-expanse |

## Links

- npm: https://www.npmjs.com/package/epstein
- npm.io page: https://npm.io/package/epstein

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2019-12-08
- 0.1.0 — 2019-10-22

## README

# Epstein

In-memory search engine written in javascript.

> Tells the story that the **Epstein Drive** is a modified fusion drive invented by Solomon Epstein around 130 years BXT (Before Extrasolar Technology) and it enabled humanity to travel beyond Earth and colonize the Inner Planets, the Asteroid Belt and outer planets due to its efficiency and power. "The Expanse"

## :wave: Newcomer

Install it:

```bash
npm i epstein
```

Basic usage:

```javascript
import epstein from 'epstein';

const docs = [
  { title: 'Leviathan Awakes', number: 1 },
  { title: 'Calibans War', number: 2 },
  { title: 'Abaddons Gate', number: 3 },
];

const index = epstein(documents);
index.search('Cal');

// [
//   { title: 'Calibans War', number: 2 }
// ]
```

## :scroll: API reference

### `epstein()`

This is the main function of `epstein` library. It will analyze all the documents and create an index to optimize your search.

```javascript
const settings = {
  search: ['title', 'content'],
  exact: ['isbn'],
};

const index = epstein(documents, settings);
```

#### `documents`:

A list of documents that you'll want to search for. Limitations by now:

- All documents must be objects with properties in a single level. (not nested)
- It does not support properties with arrays.

#### `settings`:

A map of settings to configure the way your documents will be analyzed.

| Attribute | Type                    | Description                                                                           |
| --------- | ----------------------- | ------------------------------------------------------------------------------------- |
| search    | `Array<string>`         | Attributes that will be searchable. When indexing, they'll be filtered and tokenized. |
| exact     | `Array<string\|number>` | Attributes that will be exact matched, they won't be filtered or tokenized.           |

### `index.search()`

This is the search function of epstein. It will allow you to
search for any document in that index.

```javascript
const results = index.search('query string');
```

## :bulb: Ideas

A list of todos that will be nice to have in the future. Ordered by priority.

- Stemmer and synonyms when indexing (support languages)
- Fuzzy search
- Highlight search matches
- Facets
- Search filters

---
_Source: https://npm.io/package/epstein · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
