项目作者: matteodem

项目描述 :
Easy-to-use search for Meteor with Blaze Components
高级语言: JavaScript
项目地址: git://github.com/matteodem/meteor-easy-search.git
创建时间: 2013-11-23T12:23:10Z
项目社区:https://github.com/matteodem/meteor-easy-search

开源协议:MIT License

下载


Easy Search Build Status Get help on Codementor

Easy Search is a simple and flexible solution for adding search functionality to your Meteor App. Use the Blaze Components + Javascript API to get started.

  1. import { Index, MinimongoEngine } from 'meteor/easy:search'
  2. // On Client and Server
  3. const Players = new Mongo.Collection('players')
  4. const PlayersIndex = new Index({
  5. collection: Players,
  6. fields: ['name'],
  7. engine: new MinimongoEngine(),
  8. })
  1. // On Client
  2. Template.searchBox.helpers({
  3. playersIndex: () => PlayersIndex,
  4. });
  1. <template name="searchBox">
  2. {{> EasySearch.Input index=playersIndex }}
  3. <ul>
  4. {{#EasySearch.Each index=playersIndex }}
  5. <li>Name of the player: {{name}}</li>
  6. {{/EasySearch.Each}}
  7. </ul>
  8. </template>

Check out the searchable leaderboard example or have a look at the current documentation (v1 docs) for more information.

How to install

  1. cd /path/to/project
  2. meteor add easy:search