Socket
Book a DemoInstallSign in
Socket

@delvedor/fastify-workshop-dataset

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@delvedor/fastify-workshop-dataset

Adds a basic dataset to Elasticsearch for workshop and testing purposes.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

fastify-workshop-dataset

Adds a basic dataset to Elasticsearch for workshop and testing purposes.

This module creates a tweets index and adds 67 Game of Thrones line tweets to it.
A tweet is structured as follows:

{
  id: String,
  text: String,
  user: String,
  time: DateString,
  topics: String[]
}

It will upload the data only if the the tweets index is not present.

Usage

npm i @delvedor/fastify-workshop-dataset
fastify.register(
  require('fastify-elasticsearch'),
  { node: 'http://localhost:9200' }
)

fastify.register(require('@delvedor/fastify-workshop-dataset'))

Timeline query

This plugin also exposes a generateTimelineQuery utility, that helps you create a complex query to get the data ordered by time and boosted by a given array of topics.
The first argument is the topics array, while the second is the Elasticsearch from parameter.

const query = fastify.generateTimelineQuery(['winter', 'sword'])

License

MIT

FAQs

Package last updated on 13 Nov 2019

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