0

我正在使用 Solr 8.5 和 JSON Facet API。我想按金额(正数,负数)分组,在里面我的职位类别,并将金额加在一起。我的查询如下:

    POST http://localhost:8983/solr/wallet-positions/select
    Content-Type: application/json

    {
        "

    query": "*:*",
        "limit": 100,
        "facet": {
            "type": "range",
            "field": "amount",
            "ranges": [
                {
                    "from": "0",
                    "inclusive_from": true
                },
                {
                    "to": "0",
                    "inclusive_to": false
                }
            ],
            "facet": {
                "category": {
                    "type": "terms",
                    "field": "category",
                    "missing": true,
                    "facet": {
                        "total_amount": "sum(amount)",
                    }
                }
            }
        }
    }

我收到以下异常:

"msg": "org.apache.solr.search.SyntaxError: Unknown aggregation agg_range in ('range', pos=5)",

关于这个问题的任何想法?

4

0 回答 0