# flumeview-search

> fulltext search as a flumeview.

Latest version **2.0.0** (published 2020-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install flumeview-search
pnpm add flumeview-search
yarn add flumeview-search
bun add flumeview-search
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-06-15 |
| First published | 2018-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | 'Dominic Tarr' |
| Maintainers | arj03, christianbundy, dominictarr, regular |

## Links

- npm: https://www.npmjs.com/package/flumeview-search
- Repository: https://github.com/dominictarr/flumeview-search
- Issues: https://github.com/dominictarr/flumeview-search/issues
- npm.io page: https://npm.io/package/flumeview-search

## Dependencies (4)

- [pull-stream](https://npm.io/package/pull-stream.md) ^3.0.1
- [pull-paramap](https://npm.io/package/pull-paramap.md) ^1.2.2
- [pull-pushable](https://npm.io/package/pull-pushable.md) ^2.2.0
- [flumeview-level](https://npm.io/package/flumeview-level.md) ^4.0.3

## Recent versions

- 2.0.0 (latest) — 2020-06-15
- 1.0.7 — 2020-05-25
- 1.0.6 — 2018-08-21
- 1.0.4 — 2018-05-26
- 1.0.3 — 2018-05-05
- 1.0.2 — 2018-04-14
- 1.0.1 — 2018-03-03
- 1.0.0 — 2018-03-03

## README

# flumeview-search

fulltext search as a flumeview.

## example

``` js
var FlumeViewSearch = require('flumeview-search')
var pull = require('pull-stream')
var Flume = require('flumedb')
var OffsetLog = require('flumelog-offset')

var minLength = 3 //index words at least this long

var db = Flume(OffsetLog('/tmp/flume-search-example'))

  .use('search', FlumeViewSearch(1, minLength, function (doc) {
    return doc.text //return the string you want indexed
  })

pull(
  db.search.query({query: 'foo bar baz', limit: 10}),
  pull.drain(console.log)
)
```

## api

### FlumeViewSearch(version, minLength, map) => search

`version` is the view version. if this number changes to what is on disk, the index will
regenerate.

`minLength` is the minimum word length to index. by default this is 3 letters.

`map` is a function that takes the document, and returns a string containing the text to be
indexed.

### search.query ({query, limit, keys, values}) => PullSource

create a pull-stream source of results for this query. query should be a string,
and may contain multiple words. (words shorter than `minLength` are ignored)
The order is in reverse chronological order.



## License

MIT

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