搜索结果正在快递途中

请教如何提高es中查询速度?

Elasticsearch | 作者 ddd3500 | 发布于2016年08月30日 | 阅读数:6114

用下面的查询速度很快, 实际由于filter条件限制多, 查出来的数据量确实也不多
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{"term":{"type1":"aaa"}},
{"term":{"type2":"bbb"}},
{"term":{"type3":"ccc"}}
]
}
}
}
},
"size": 100

但是一旦加上query部分wildcard后就非常慢. 有没有什么办法是在filter基础上再做query的查询吗?
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{"term":{"type1":"aaa"}},
{"term":{"type2":"bbb"}},
{"term":{"type3":"ccc"}}
]
}
},
"query": {
"bool": {
"should": [
{"wildcard": {"name1": "*ddd*"}},
{"wildcard": {"name1": "*eee*"}}
]
}
}
}
},
"size": 100
已邀请:

yangruideyang

赞同来自:

这种又带通配符还是should的查询本身就比较慢吧

要回复问题请先登录注册