2

我已使用以下查询来匹配所有文档

{
 "query": {
    "custom_score": {
       "query": {
          "query_string": {
                 "query": "*"
           }
     },
    "script": "_score"
  }
 }
}

但不幸的是,我收到以下错误

{
  "took": 1515,
  "timed_out": false,
  "_shards": {
    "total": 7,
    "successful": 6,
    "failed": 1,
    "failures": [
      {
    "status": 500,
    "reason": "RemoteTransportException[[els][inet[/192.168.1.226:9300]][search/phase/fetch/id]]; nested: IllegalArgumentException[docID must be >= 0 and < maxDoc=53134 (got docID=214747)]; "
      }
    ]
  },
  "hits": {
    "total": 1574502,
    "max_score": null,
    "hits": [

    ]
  }
}

注意:我使用 0.90.3 es 版本,这个集群使用四个节点

我只在 0.90.3 中遇到这个问题。

有什么解决方案可以防止这个问题吗?

谢谢,

4

1 回答 1

0

我不知道它一定会解决您的问题,但是要匹配所有文档,您应该使用match all query

"custom_score": {
  "query": {
    "match_all" : { }
  },
  "script": "_score"
}
于 2013-09-13T15:49:51.663 回答