使用Transport Client 6.1查询嵌套对象时出现弹性搜索错误

时间:2019-06-10 09:45:42

标签: elasticsearch elasticsearch-plugin elasticsearch-aggregation elasticsearch-6

预先感谢您的帮助。

我正在使用Elastic search Transport client 6.1从多个索引中获取查询数据。我有多个索引,但只有少数具有嵌套对象。执行QueryBuilder执行时,它抛出以下异常:

Caused by: java.lang.IllegalStateException: [nested] failed to find nested object under path [tags]
    at org.elasticsearch.index.query.NestedQueryBuilder.doToQuery(NestedQueryBuilder.java:279) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:97) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:405) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:379) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.AbstractQueryBuilder.toQuery(AbstractQueryBuilder.java:97) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.QueryShardContext.lambda$toQuery$2(QueryShardContext.java:304) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:316) ~[elasticsearch-6.2.4.jar:6.2.4]
    at org.elasticsearch.index.query.QueryShardContext.toQuery(QueryShardContext.java:303) ~[elasticsearch-6.2.4.jar:6.2.4]

我直接从邮递员运行rest查询,这给了我一些失败错误消息的结果。

我可以在传输客户端中配置一些设置,以便它忽略没有嵌套文档的索引吗?

0 个答案:

没有答案