Easy Search is a simple and flexible solution for adding Search Components to your Meteor App. Read the documentation to get started.
import { Index, MinimongoEngine } from 'meteor/easy:search'
// On Client and Server
const Players = new Mongo.Collection('players')
const PlayersIndex = new Index({
collection: Players,
fields: ['name'],
engine: new MinimongoEngine()
})
// On Client
Template.searchBox.helpers({
playersIndex: () => PlayersIndex,
})
<template name="searchBox">
{{> EasySearch.Input index=playersIndex }}
<ul>
{{#EasySearch.Each index=playersIndex }}
<li>Name of the player: {{name}}</li>
{{/EasySearch.Each}}
</ul>
</template>
Check out the searchable leaderboard example for a project implemented with EasySearch. Documentation for v1 can be found here.
cd /path/to/project
meteor add easy:search