package
Adds a basic dataset to Elasticsearch for workshop and testing purposes.
npm install @delvedor/fastify-workshop-datasetGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 6 packages.
181.1 kB
Includes dependencies.
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.
npm i @delvedor/fastify-workshop-datasetfastify.register(
require('fastify-elasticsearch'),
{ node: 'http://localhost:9200' }
)
fastify.register(require('@delvedor/fastify-workshop-dataset'))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'])MIT