查询返回[parsing_exception] [size]查询格式错误,查询名称后没有start_object,其中{line = 1& col = 264} [英] query return [parsing_exception] [size] query malformed, no start_object after query name, with { line=1 & col=264 }

查看:487
本文介绍了查询返回[parsing_exception] [size]查询格式错误,查询名称后没有start_object,其中{line = 1& col = 264}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Elasticsearch的新手,我尝试使用开发工具来创建过滤器. 这是我要使用的工作

I'm new in elasticsearch, and i try to use dev tools to create filters. here is what work and I want to use

POST /transform_alldomain/_search
{
  "size":0,
    "aggs": {
        "group": {
            "terms": {
                "field": "Email.keyword"
            },
            "aggs": {
        "group": {
            "terms": {
                "field": "bln.keyword"
            },
            "aggs": {
                "group_docs": {
                    "top_hits": {
                        "size": 1,
                        "sort": [
                            {
                                "extract_date.max": {
                                    "order": "desc"
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
}
}}

现在我要使用类似的东西进行过滤,将其输入到过滤器中,然后作为查询dsl编辑

now i want to use this similiar stuff to filter as type this into filter, edit as query dsl

{
  "size":0,
    "aggs": {
        "group": {
            "terms": {
                "field": "Email.keyword"
            },
            "aggs": {
        "group": {
            "terms": {
                "field": "bln.keyword"
            },
            "aggs": {
                "group_docs": {
                    "top_hits": {
                        "size": 1,
                        "sort": [
                            {
                                "extract_date.max": {
                                    "order": "desc"
                                }
                            }
                        ]
                    }
                }
            }
        }
    }
}
}}

它返回

[parsing_exception] [size] query malformed, no start_object after query name, with { line=1 & col=324 }

我不知道有什么区别以及如何使它起作用

I don't know what is the difference and how to make it work

我需要从中创建搜索对象

I need to create searched object from this

我如何执行过滤器:

返回

推荐答案

发现"应用程序不是用于进行聚合的正确工具,发现"应用程序仅对查询和过滤器有用.

The Discover app is not the right tool to use to make aggregations, the Discover app is only useful for queries and filters.

您想要实现的目标可以通过数据表可视化来完成.因此,请选择可视化",而不是发现",然后选择创建可视化"

What you want to achieve can be done with a Data table visualization. So instead of Discover, go to Visualize, then pick "Create Visualization"

然后选择数据表"可视化

Then pick the "Data Table" Visualization

然后选择您的索引模式

最后,您可以像这样定义两个terms聚合:

And finally you can define your two terms aggregations like this:

这篇关于查询返回[parsing_exception] [size]查询格式错误,查询名称后没有start_object,其中{line = 1& col = 264}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆