Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docproc

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docproc

A document processing pipeline

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
decreased by-57.5%
Maintainers
1
Weekly downloads
 
Created
Source

docproc

A document processing pipeline mostly used with search-index

docProc = require('docproc')
readableStream.pipe(docProc.pipeline(ops))

DocProc is a pumpify chain of transform streams that turns Plain Old JSON Objects into a format that can be indexed by search-index.

Each processed document must have the following fields:

  • id - document id
  • vector - searchable vector, used for ranking
  • stored - the document that will be cached
  • raw - the unadulterated document
  • normalised - the "cleaned up" document.

So

  {
    id: 'one',
    text: 'the first doc'
  }

becomes

  { id: 'one',
    vector: 
    { id: { one: 1, '*': 1 },
      text: { doc: 1, first: 1, the: 1, '*': 1 },
      '*': { one: 1, '*': 1, doc: 1, first: 1, the: 1 } },
    stored: { id: 'one' },
    raw: { id: 'one', text: 'the first doc' },
    normalised: { id: [ 'one' ], text: [ 'the', 'first', 'doc' ] } }

...after being passeds through docProc.

Options

See: https://github.com/fergiemcdowall/search-index/blob/master/doc/API.md#options-and-settings

Keywords

FAQs

Package last updated on 10 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc