,当我有麻烦访问我Elasticsearch指数 一些多值数组我使用的查询中 retrieving the multivalued array from elasticsearch 但我得到空poiter例外,我的一些索引中的文档,其中用于数组给定的搜索存在,当我使用的queryString查询,而不是MATCH_ALL。这occures空指针异常检索多值阵列场
{
took: 3
timed_out: false
_shards: {
total: 2
successful: 1
failed: 1
failures: [
{
status: 500
reason: NullPointerException[null]
}
]
}
我查询
{
"query":{
"query_string":{
"query":"report","default_field":"Content"
}
},
"script_fields": {
"entity_facets": {
"script": "result=[];foreach(facet : _source.Categories.Types.Events)
{if(facet.event==event) result.add(facet);} result",
"params": {
"event":"AnalystEvent"
}
}
}
}
编辑: 我有一个索引 https://gist.github.com/4129488 我得到了通过运行查询
{
"from": "0",
"size": "100",
"query": {
"bool": {
"must": [
{
"bool": {
"must": [
{
"query_string": {
"query": "confronted",
"default_field":"Content"
}
},
{
"range": {
"actualTimeStamp": {
"from": "23-07-2012 10:04:52",
"to": "23-09-2012 10:04:52"
}
}
}
]
}
},
{
"bool": {
"should": [
{
"fuzzy": {
"SourceName": {
"value": "Economic_Times"
}
}
},
{
"fuzzy": {
"SourceName": {
"value": "reuters"
}
}
}
]
}
}
]
}
}
}
但我没有”上面的查询使用第脚本场时得到这个指标!
你好家伙有什么想法吗? – user1790894