Skip to content

Index Mongoose models into elasticsearch automatically. Looking for maintainers!

License

Notifications You must be signed in to change notification settings

danielecapuano-dev/mongoosastic

 
 

Repository files navigation

LOOKING FOR MAINTAINERS

This project is looking for contributors/maintainers. Please check issue #457. If you, or anyone you know, work with Mongoose and/or ElasticSearch please let them know that we'd appreciate any help. Thanks!

Mongoosastic

Build Status NPM version Coverage Status Downloads Gitter

Mongoosastic is a mongoose plugin that can automatically index your models into elasticsearch.

Getting started

  1. Install the package
npm install -S mongoosastic
  1. Setup your mongoose model to use the plugin
var mongoose     = require('mongoose')
  , mongoosastic = require('mongoosastic')
  , Schema       = mongoose.Schema

var User = new Schema({
    name: String
  , email: String
  , city: String
})

User.plugin(mongoosastic)
  1. Query your Elasticsearch with the search() method (added by the plugin)
User.search({
  query_string: {
    query: "john"
  }
}, function(err, results) {
  // results here
});

NOTE: You can also query Elasticsearch with any other method. Example:

curl http://localhost:9200/users/user/_search

Documentation

View docs

About

Index Mongoose models into elasticsearch automatically. Looking for maintainers!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.3%
  • Other 0.7%