繁体   English   中英

在 elasticsearch 中使用聚合时出错

[英]error using aggregations in elasticsearch

我正在使用 elasticsearch java Api 并且我正在尝试运行此查询以检索结果。 但我遇到了一个解析异常。 你能帮我弄清楚问题出在哪里吗? 我会很感激

{
    "size": 0,
    "query": {
        "bool": {
            "must": [{
                    "query_string": {
                        "query": "data~ AND gaps~",
                        "default_field": "all_muses",
                        "fields": [],
                        "type": "best_fields",
                        "default_operator": "or",
                        "max_determinized_states": 10000,
                        "enable_position_increments": true,
                        "fuzziness": "AUTO",
                        "fuzzy_prefix_length": 0,
                        "fuzzy_max_expansions": 50,
                        "phrase_slop": 0,
                        "escape": false,
                        "auto_generate_synonyms_phrase_query": true,
                        "fuzzy_transpositions": true,
                        "boost": 1.0
                    }
                }
            ],
            "adjust_pure_negative": true,
            "boost": 1.0
        }
    },
    "aggregations": {
        "groupBySerie": {
            "terms": {
                "field": "titreSerie",
                "size": 6,
                "min_doc_count": 1,
                "shard_min_doc_count": 0,
                "show_term_doc_count_error": false,
                "order": [{
                        "_count": "desc"
                    }, {
                        "_key": "asc"
                    }
                ]
            },
            "aggregations": {
                "groupBySf": {
                    "terms": {
                        "field": "sousFamille",
                        "size": 10,
                        "min_doc_count": 1,
                        "shard_min_doc_count": 0,
                        "show_term_doc_count_error": false,
                        "execution_hint": "global_ordinals_low_cardinality",
                        "order": [{
                                "_count": "desc"
                            }, {
                                "_key": "asc"
                            }
                        ]
                    }
                }
            }
        }
    }
}

这是我得到的例外

ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception 
[type=parse_exception, reason=parse_exception: Encountered " ":" ": "" at line 1, column 36.
20:55:55,464 INFO  [stdout] (http-localhost/127.0.0.1:8080-3) Was expecting one of:
20:55:55,464 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <NOT> ...
20:55:55,464 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "+" ...
20:55:55,464 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "-" ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <BAREOPER> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "(" ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "*" ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <QUOTED> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <TERM> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <PREFIXTERM> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <WILDTERM> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <REGEXPTERM> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "[" ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "{" ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <NUMBER> ...
20:55:55,465 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     <TERM> ...
20:55:55,466 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     "*" ...
20:55:55,466 INFO  [stdout] (http-localhost/127.0.0.1:8080-3)     ]];

“我正在使用 elasticsearch java Api 并且我正在尝试运行此查询以检索结果。但我正在开始解析异常。我会感谢您帮助我解决解析问题吗?

execution_hint参数不接受global_ordinals_low_cardinality值,但只接受mapglobal_ordinals

You need to make sure that the version of your client Java API is in synch with the version of your ES cluster, as it seems that you're using an old client Java API.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM