JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 933
  • Score
    100M100P100Q103363F
  • License MIT

A document processing pipeline

Package Exports

  • docproc

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (docproc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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