Tag: elasticsearch mongoose mongoosastic

Mongoosastic – 将ObjectId索引到弹性search中

索引到Elastic Search时,我想索引我的mongoDB objectID 喜欢这个 : _id : {type: mongoose.Schema.Types.ObjectId, es_indexed:true}, parentItem : {type: mongoose.Schema.Types.ObjectId, Ref:'SystemItem', es_indexed:true } 当mongoosastic将我的数据库导入到弹性search时,这产生undefined 有办法做到这一点? 或者我应该走另一条路?

Mongoose和node.js中的ElasticSearch

我现在用mongoose在node.js中使用mongoDB,我想使用ElasticSearch。 现在任何人都可以告诉我,使用mongoosastic ,mongoose和ElasticSearch都是npm模块,还是应该单独安装ElasticSearch ?

为什么mongoosastic填充/弹性search不填充我的一个引用? 我得到一个空的对象

我有两个模型,我试图引用。 风格和品牌。 品牌填充所需的对象,但风格总是空的。 我已经尝试清除caching/删除索引。 有和没有include_in_parent并input:'nested'。 我觉得这可能与指定的es_type等有关。不知道。 产品架构: 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}, brand: {type: mongoose.Schema.Types.ObjectId, ref: 'Brand', es_type:'nested', es_include_in_parent:true}, style: {type: mongoose.Schema.Types.ObjectId, ref: 'Style', es_schema: Style, […]

我如何做mongoosastic填充?

我的目标是填写某些领域的mongoosasticsearch,但如果我做下面的代码,它将永远返回 这是代码 var mongoose = require('mongoose'); var Category = require('./category'); var mongoosastic = require('mongoosastic'); var Schema = mongoose.Schema; var ProductSchema = new Schema({ category: { type: Schema.Types.ObjectId, ref: 'Category', es_schema: Category, es_indexed:true, es_select: 'name'}, name: String, price: Number, image: String }); ProductSchema.plugin(mongoosastic, { hosts: [ 'localhost:9200' ], populate: [ {path: 'category', select: 'name'} ] }); […]