@kth/kth-search-push-util

    2.0.1 • Public • Published

    kth-search-push-util

    Utils to simplifie pushing information to KTH:s search solution

    Examples

    const log = require('kth-node-log')
    const { SearchPush } = require('@kth/kth-node-search-push-util')
    
    const config = {
      log: log,
      client: api.client,
      paths: api.paths,
      batchSize: 10
    }
    
    const util = new SearchPush(config)
    
    const import = async (pages) => {
      for (let page of pages) {
        await util.pushPage(page)
      }
    
      await util.flush()
    
      await cleanup()
    }
    
    const cleanup = () => {
      return util.deletePages('type', new Date())
    }

    Install

    npm i @kth/kth-search-push-util

    DownloadsWeekly Downloads

    13

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    13.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • kthwebmaster
    • wkchung
    • exacs
    • ssundkvist
    • kth-ci
    • emilstenberg