Tag: elasticsearch mongoosastic

使用mongoosastic来自动完成

我正在尝试使用mongoosastic和Elastic Search创build一个自动完成,到目前为止,我已经能够使用感觉来创build自动完成,但是我无法将其移植到mongoosastic中。 我遵循ElasticSearch文档中的这个教程,我能够通过一个如下所示的映射来实现我想要的“sense”: PUT storys/story/_mapping { "story" : { "properties": { "description": { "type": "string" }, "title": { "type" : "completion", "index_analyzer": "simple", "search_analyzer": "simple" } } } } 和这样的查询: GET storys/_suggest { "story-suggest": { "text": "bow", "completion": { "field": "title" } } } 不过,我无法将其移植到mongoosastic中。 我尝试了以下方法: var StorySchema = new Schema({ title:{ type: String, es_type:'completion', […]