elasticsearch无法在路径下找到嵌套对象

时间:2017-11-09 17:12:59

标签: java elasticsearch

你好我有这个ood错误在elasticsearch搜索数据时我得到这个错误。

`

[2017-11-09 18:14:30,977][DEBUG][action.search            ] [Xorn] All shards failed for phase: [query]
RemoteTransportException[[Xorn][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: SearchParseException[failed to parse search source [{"from":0,"size":15,"query":{"bool":{"must":[{"query_string":{"query":"ctDossierType:(TrademarkApplication)"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"query_string":{"query":"design:(false)"}}]}},"sort":[{"stComparableApplicationNumber":{"order":"desc","missing":"_last","ignore_unmapped":true}}]}]]; nested: QueryParsingException[[nested] failed to find nested object under path [ntComments]];
Caused by: SearchParseException[failed to parse search source [{"from":0,"size":15,"query":{"bool":{"must":[{"query_string":{"query":"ctDossierType:(TrademarkApplication)"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"nested":{"query":{"bool":{"must":{"query_string":{"query":"ntComments.comment:(xcbxcv)"}}}},"path":"ntComments"}},{"query_string":{"query":"design:(false)"}}]}},"sort":[{"stComparableApplicationNumber":{"order":"desc","missing":"_last","ignore_unmapped":true}}]}]]; nested: QueryParsingException[[nested] failed to find nested object under path [ntComments]];

`

有趣的是,当搜索字段中没有参数时,它会起作用。系统与其他系统重复,而在另一个系统上它可以工作。事情是它全部自动生成。

嵌套查询 `

{
  "nested" : {
    "query" : {
      "bool" : {
        "must" : {
          "query_string" : {
            "query" : "ntComments.comment:(blablabla)"
          }
        }
      }
    }
    "path" : "ntComments"
  }
} `

nested bool query


`{
   "bool" : {
    "must" : {
     "query_string" : {
      "query" : "ntComments.comment:(blablabla)"
     }
    }
   }
  }
 ntComments
 must : {
  "bool" : {
   "must" : [ {
    "query_string" : {
     "query" : "ctDossiertype:(typetypetype)"
    }
   }, { 
    "nested" : {
     "query" : {
      "bool" : {
       "must" : {
        "query_string" : {
         "query" : "ntComments.comment:(blablabla)"
        }
       }
      }
     },
     "path" : "ntComments"
    }
   }, {
    "nested" : {
     "query" : {
      "bool" : {
       "must" : {
        "query_string" : {
         "query" : "ntComments.comment:(blablabla)"
        }
       }
      }
     }, 
     "path" : "ntComments"
    }
   }]
  }
 }

`

我对它疯狂,任何为什么它不起作用的想法都会很棒。

0 个答案:

没有答案