mongoosastic

mongoosesastic no living connection

房东的猫 提交于 2019-12-06 08:22:13
问题 I'm trying to insert my mongoose scheme into elasticsearch with mongoosastic but it gives me { [Error: No Living connections] message: 'No Living connections' } my mongoose schema: var mongoose = require( 'mongoose' ); var Schema = mongoose.Schema; var mongoosastic = require('mongoosastic'); var ProductSchema = new Schema( { ----huge load of json---- }); ProductSchema.plugin(mongoosastic,{host:'xxx.xxx.xxx.xxx:9200',curlDebug: true}); mongoose.model('product', ProductSchema); var product =

Why is mongoosastic populate / elastic search not populating one of my references? I'm getting an empty object

╄→гoц情女王★ 提交于 2019-12-06 01:20:17
问题 I have two models I'm attempting to reference. Style and Brand. Brand populates with the needed object, but Style is always empty. i've tried clearing cache / deleting indexes. With and without include_in_parent and type: 'nested'. I feel it may have something to do with the specified es_type, etc.. not sure. Product Schema: var mongoose = require('mongoose'); var Schema = mongoose.Schema; var Style = require('./style'); var Brand = require('./brand'); var mongoosastic = require('mongoosastic

Mongoosastic - { [Error: No Living connections] message: 'No Living connections' }

梦想的初衷 提交于 2019-12-04 10:16:11
Im trying to use mongoosastic for searching purposes, but I keep getting 'No Living connections' error and mapping problem Here's the code var mongoose = require('mongoose'); var mongoosastic = require('mongoosastic'); var Schema = mongoose.Schema; var JobSchema = Schema({ category: { type: Schema.Types.ObjectId, ref: 'Category', es_indexed:true}, title: { type: String, es_indexed:true }, }); JobSchema.plugin(mongoosastic); module.exports = mongoose.model('Job', JobSchema); routes.js var Job = require('../models/job'); Job.createMapping(function(err, mapping) { if (err) { console.log('error

Why is mongoosastic populate / elastic search not populating one of my references? I'm getting an empty object

我的未来我决定 提交于 2019-12-04 06:52:58
I have two models I'm attempting to reference. Style and Brand. Brand populates with the needed object, but Style is always empty. i've tried clearing cache / deleting indexes. With and without include_in_parent and type: 'nested'. I feel it may have something to do with the specified es_type, etc.. not sure. Product Schema: var mongoose = require('mongoose'); var Schema = mongoose.Schema; var Style = require('./style'); var Brand = require('./brand'); var mongoosastic = require('mongoosastic'); var ProductSchema = new mongoose.Schema({ name: { type: String, lowercase: true , required: true},

How to do instant search with mongoosastic + AJAX?

偶尔善良 提交于 2019-12-01 05:49:16
I have configured mongoosastic successfully, I tried searching and it is working fine, but when it comes to front-end I'm not really sure on how to achieve this, I experimented with a lot of ways but couldn't come up with a good solution. Here's the code. // For the Search API router.post('/api/search/', function(req, res, next) { Job.search( { query_string: { query: req.body.search } } , function(err, results) { if (err) return next(err); res.json(results); }); }); So whenever I search something that is related to 'engineer', I will get a json data So the backend does working perfectly.