Elasticsearch.js项查询返回0个匹配,映射设置为“not_analyzed”

我一直在尝试使用“术语”查询来search我的ES数据库。 我一直得到0点击。

这是我的映射:

function initUserMapping() { return elasticClient.indices.putMapping({ index: "user", type: "document", body: { properties: { fullName: { type: "string", index: "not_analyzed" }, email: { type: "string", index: "not_analyzed" }, password: { type: "string", index: "not_analyzed" }, movies: { type: "object" } } } }); } 

这是我如何将值添加到“用户”索引(所有值是除电影以外的stringtypes):

 function addUser(User) { console.log(User); return elasticClient.index({ refresh: true, index: "user", type: "document", body: { properties: { fullName: User.fullName, email: User.email, password: User.password, movies: {} } } }); } 

这是我试图查询数据库的许多变化之一:

 function loginUser(User) { console.log(User); return elasticClient.search({ index: 'user', body: { query: { term: { email: User.email } } } }); } 

这是我始终得到的回应:

 { "took": 0, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 0, "max_score": null, "hits": [] } }