在查询_source.includes中包含超过1500个字段的索引时,我从ES中得到以下错误。
错误日志:
{
"took": 154,
"timed_out": false,
"_shards": {
"total": 28,
"successful": 15,
"skipped": 0,
"failed": 13,
"failures": [
{
"shard": 0,
"index": "index123",
"node": "...",
"reason": {
"type": "too_complex_to_determinize_exception",
"reason": "too_complex_to_determinize_exception: Determinizing automaton with 52903 states and 54499 transitions would result in more than 10000 states."
}
}
]
},....
下面是我要执行的示例查询。
查询示例:
{
"explain": false,
"size": 20,
"query": {
"bool": {
"filter": [
{
"bool": {
"adjust_pure_negative": true,
"must": [
{
"terms": {
"boost": 1,
"type": [
"University"
]
}
}
],
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"from": 0,
"_source": {
"excludes": [
],
"includes": [
--1579 fields included --
]
}
}
Note:当尝试将字段数量降低到_source.includes中的1440个左右时,ES能够在没有错误的情况下给出响应。
我想知道在_source中添加的数字字段是否有任何硬限制,或者是否有任何配置设置来增加这个限制。
如果有其他方法可以让这么多的字段被包含并从ES中返回的话,这也是有帮助的。
提前感谢!
发布于 2021-11-26 06:55:58
对于这么多字段,您应该排除(使用_source.excludes
)不需要的字段,而不是包含所需的字段,查询中的字段将更少。
另一种解决方案,因为_source
has limitations with a high number of fields,您还可以利用通常比_source
性能更好的fields
option。
https://stackoverflow.com/questions/70114146
复制相似问题