弹性搜索NumberFormatException聚合术语查询

时间:2014-11-27 07:34:13

标签: elasticsearch numberformatexception elasticsearch-aggregation

我不知道我做错了什么。我在整数字段“状态”上有一个术语聚合,但是通过运行查询得到NumberFormatException。我有2个状态字段,一个在_source.status中,类型为整数,另一个是_source.report.status,类型为

错误消息

{
  "error": "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed;
            shardFailures {[qIeOaS8SS4ynp938pIXZyg][outboxprov1][3]:
            ElasticsearchException[java.lang.NumberFormatException:
            Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: UncheckedExecutionException[java.lang.NumberFormatException:
                      Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][4]:
            ElasticsearchException[java.lang.NumberFormatException:
            Invalid shift value in prefixCoded bytes (is encoded value really an INT?)];
              nested: UncheckedExecutionException[java.lang.NumberFormatException: 
                      Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][0]:
            ElasticsearchException[java.lang.NumberFormatException: 
            Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: UncheckedExecutionException[java.lang.NumberFormatException: 
                      Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][1]: 
            ElasticsearchException[java.lang.NumberFormatException: 
            Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: UncheckedExecutionException[java.lang.NumberFormatException: 
                      Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }{[qIeOaS8SS4ynp938pIXZyg][outboxprov1][2]:
            ElasticsearchException[java.lang.NumberFormatException: 
            Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: UncheckedExecutionException[java.lang.NumberFormatException: 
                      Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; 
              nested: NumberFormatException[Invalid shift value in prefixCoded bytes (is encoded value really an INT?)]; }]",
  "status": 500
}

查询

{
  "size": 0,
  "query": {
    "match_all": {}
  },
  "aggs": {
    "total": {
      "terms": {
        "field": "status", // type : "integer"
        "order": {
          "_term": "asc"
        }
      }
    },
    "immediate_total": {
      "terms": {
        "field": "immediate",
        "order": {
          "_term": "asc"
        }
      }
    },
    "daily_post_count": {
      "filter": {
        "range": {
          "created_date": {
            "from": "2014-11-27",
            "to": "2014-11-27"
          }
        }
      },
      "aggs": {
        "today_posts": {
          "terms": {
            "field": "status", // type : "integer"
            "order": {
              "_term": "asc"
            }
          }
        },
        "today_immediate": {
          "terms": {
            "field": "immediate",
            "order": {
              "_term": "asc"
            }
          }
        }
      }
    }
  }
}

映射

{
   "test": {
      "mappings": {
         "message": {
            "properties": {
               "approved_date": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "approver": {
                  "type": "string"
               },
               "content": {
                  "type": "string",
                  "store": true
               },
               "contents": {
                  "properties": {
                     "'facebook'": {
                        "type": "string"
                     },
                     "approver": {
                        "type": "string"
                     },
                     "contents": {
                        "type": "string"
                     },
                     "created_date": {
                        "type": "date",
                        "format": "dateOptionalTime"
                     },
                     "facebok": {
                        "type": "string"
                     },
                     "facebook": {
                        "type": "string"
                     },
                     "failed": {
                        "type": "long"
                     },
                     "hash": {
                        "type": "string"
                     },
                     "immediate": {
                        "type": "long"
                     },
                     "link": {
                        "type": "string"
                     },
                     "linkedin": {
                        "type": "string"
                     },
                     "message_date": {
                        "type": "date",
                        "format": "dateOptionalTime"
                     },
                     "network_connectors": {
                        "type": "string"
                     },
                     "post_count": {
                        "type": "long"
                     },
                     "preview": {
                        "type": "string"
                     },
                     "preview_description": {
                        "type": "string"
                     },
                     "preview_image_url": {
                        "type": "string"
                     },
                     "preview_title": {
                        "type": "string"
                     },
                     "sent": {
                        "type": "long"
                     },
                     "status": {
                        "type": "long"
                     },
                     "twitter": {
                        "type": "string"
                     }
                  }
               },
               "created_date": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "created_ip": {
                  "type": "ip"
               },
               "created_user": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "failed": {
                  "type": "long"
               },
               "folder": {
                  "type": "integer"
               },
               "hash": {
                  "type": "string"
               },
               "immediate": {
                  "type": "long"
               },
               "link": {
                  "type": "string"
               },
               "message_date": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "modified_date": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "network_connectors": {
                  "type": "string",
                  "index": "not_analyzed"
               },
               "post_count": {
                  "type": "long"
               },
               "preview": {
                  "type": "string"
               },
               "preview_description": {
                  "type": "string"
               },
               "preview_image_url": {
                  "type": "string"
               },
               "preview_title": {
                  "type": "string"
               },
               "report": {
                  "properties": {
                     "info": {
                        "type": "string"
                     },
                     "networks": {
                        "type": "string"
                     },
                     "status": {
                        "type": "long"
                     }
                  }
               },
               "sent": {
                  "type": "long"
               },
               "status": {
                  "type": "integer"
               },
               "team_id": {
                  "type": "string",
                  "index": "not_analyzed"
               }
            }
         }
      }
   }
}

请帮我解决这个问题。谢谢。

0 个答案:

没有答案