问题描述
我对Elasticsearch功能非常陌生。我使用AWS Elasticsearch + Kibana。对于某些查询,我会收到一个例外:
ElasticsearchClientException: Request Failed to execute.
Call: Status code 500 from: POST /my-data/_search?pretty=true&error_trace=true&typed_keys=true.
ServerError: Type: search_phase_execution_exception Reason: "all shards Failed"
CausedBy: "Type: too_many_clauses Reason: "maxClauseCount is set to 1024"
我已经使用一种将maxClauseCount
设置为更大的数量的解决方案复习了该主题,但是该选项在AWS ES中不可用。有人可以帮助我更新AWS ES设置以解决此问题或查看我的nesT请求(我读过一个选项,认为错误的请求是导致此异常的原因)。
这是我的nesT请求:
{
"aggs": {
"contentType": {
"terms": {
"field": "contentType"
}
}
},"from": 0,"query": {
"bool": {
"must": [
{
"terms": {
"specialty": [
100,1
]
}
},{
"bool": {
"should": [
{
"bool": {
"must": [
{
"exists": {
"field": "isBlocked"
}
},{
"term": {
"isBlocked": {
"value": false
}
}
}
]
}
},{
"bool": {
"must_not": [
{
"exists": {
"field": "isBlocked"
}
}
]
}
}
]
}
},{
"terms": {
"contentType": [
"1","2","5","6","7","15","60","50","52"
]
}
},{
"query_string": {
"auto_generate_synonyms_phrase_query": true,"default_operator": "and","fields": [
"title^7","description^5","contentId^7","pMID^7"
],"query": "*han*","rewrite": "scoring_boolean","type": "most_fields"
}
}
]
}
},"size": 50,"sort": [
{
"_script": {
"script": {
"source": "def contentImportanceFactor = 1; if (doc['contentType'].value == 1) { contentImportanceFactor = 1.5; } else if (doc['contentType'].value == 7) { contentImportanceFactor = 0.3; } return _score*contentImportanceFactor;"
},"type": "number","order": "desc"
}
}
],"track_scores": true
}
预先感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)