即使是不成熟的尝试,也胜于胎死腹中的策略。

大家好我用elasticsearch mapper-attachment然后查询很慢,我把返回的字段都限制了还是很慢,有没得人知道啊

Elasticsearch | 作者 paopao | 发布于2015年12月28日 | 阅读数:4629

查询语句如下:
{
"fields":{},
"bool" : {
"must" : [ {
"range" : {
"rdate" : {
"from" : "2015-12-20T16:00:00.000Z",
"to" : null,
"include_lower" : true,
"include_upper" : true
}
}
}, {
"range" : {
"rdate" : {
"from" : null,
"to" : "2015-12-27T16:00:00.000Z",
"include_lower" : true,
"include_upper" : true
}
}
}, {
"multi_match" : {
"query" : "呈现",
"fields" : [ "title", "cate", "type", "rspb_unit", "rdesc", "proj", "rptitle", "l_evel", "r_region", "r_from", "casename", "contact", "rllts_code", "hazard", "clue_num", "instructions", "endanger_desc", "relationship_id", "r_serial", "leader_istc", "from_unit", "interactive.r_organization", "interactive.evidence_req", "interactive.modus_operandi", "interactive.partner", "interactive.detl_desc", "interactive.r_level", "sectcooperation.partners", "sectcooperation.contact", "sectcooperation.notify_desc", "title", "file" ]
}
} ],
"highlight":{
"fields":{}
}

}
}
已邀请:

medcl - 今晚打老虎。

赞同来自:

你配置的map-attachment字段是file吧,你去掉这个字段会变快么?
另外你这一次查询访问了这么多的字段,如果只是全文检索,可以合并到一个字段里面进行检索么?比如使用copy_to:
https://www.elastic.co/guide/e ... .html 
 
另外你的es都进行过哪些配置,是不是其它原因?如内存不会是默认值吧?

paopao

赞同来自:

1.我现在是两个类型一起查的,我试了哈,我查文件那个类型也很慢,而且我只查了file一个字段
2.es其他我没有配置过,内存应该是默认设置

要回复问题请先登录注册