0
我想查询多个表有多个索引和类型,但没有可用的文件在多索引,mongoosastic中的多种类型查询。如何在mongoosastic中查询多指标,多指标?
请参考这个doc试图做同样的事情,但与mongoosastic查询。
我想查询多个表有多个索引和类型,但没有可用的文件在多索引,mongoosastic中的多种类型查询。如何在mongoosastic中查询多指标,多指标?
请参考这个doc试图做同样的事情,但与mongoosastic查询。
我有同样的问题。请执行以下操作以使其正常工作。
确保您删除索引:
通过邮递员例如DELETE请求:http://127.0.0.1:9200/ {your_name}
然后在节点JS创建这样的映射:
var schema = new Schema({
product_name: String,
description: {
type: String,
es_type: 'multi_field',
es_fields: {
multi_field: { type: 'string', index: 'analyzed' },
untouched: { type: 'string', index: 'not_analyzed' }
}
}
});
最后,你可以像这样的查询:
{
"query" : {
"constant_score" : {
"filter" : {
"term" : {
"description.multi_field" : "nog een testje"
}
}
}
}}// to use other field, change the . after description
{
"query" : {
"constant_score" : {
"filter" : {
"term" : {
"description.untouched" : "nog een testje"
}
}
}
}
}