【发布时间】:2017-01-07 15:40:47
【问题描述】:
我们有一个mongoose 对象,其架构如下,使用timestamps,我们正在填充 createdAt 和 updatedAt 字段。我们在弹性搜索中使用mongoosastic 来索引这些。
var mongoose = require("mongoose");
var employeeSchema = new mongoose.Schema(
{
name: {
type: String
es_indexed: true,
es_index:"analyzed"
},
managerId: {type: mongoose.Schema.Types.ObjectId},
details:{},
email: {
type: String
es_indexed: true,
es_index:"analyzed"
},
phone: {
type: Number
es_indexed: true,
es_index:"analyzed"
}
},
{
timestamps: true
});
我也想在弹性搜索中索引updatedAt,但不确定如何使用 mongoosastic。请让我知道这些特定的选项可以完成这项工作。
【问题讨论】:
-
如何索引文档?你用什么来索引?
标签: node.js elasticsearch mongoose mongoosastic