1

我已经设置了 mongoosastic 来将我的文档索引到弹性搜索。问题是,尽管有模式集,但所有字段都被索引了。

我的架构:

id: { type: String, index: true },
title: String,
title_lower: { type: String, es_indexed: true, es_boost: 2.0 },
slug: String,
city: { type: String, es_indexed: true },
country: { type: String, es_indexed: true },
genre: [{ type: String, es_indexed: true }],
description: { type: String, es_indexed: true },
gallery: [{ title: String, images: { thumbnail: String, medium: String, full: String }}],
date: { start: String, end: String },
price: { min: Number, max: Number },
temperature: Number,
weather: String,
comments: [CommentSchema],
lineup: { type: [LineupSchema], es_indexed: true }

在这里,我只想索引 title_lower、城市、流派、描述和阵容。但是检查弹性如:http://localhost:9200/events/_search我可以看到所有字段都添加在_source下。

4

0 回答 0