如何强制 Solr 在与请求中指定的边界没有区别的边界内构建空间热图?

How to force Solr to build spatial heatmap in bounds that won't differ from bounds specified in the request?

这是 Solr 热图响应的示例:

{
    "responseHeader": {
        "params": {
            "q": "*:*",
            "facet.heatmap": "location_p",
            "facet.heatmap.geom": "[\"0.6247379779815674 51.52351760864258\" TO \"5.051644802093506 51.570556640625\"]",
            "facet.heatmap.distErrPct": "0.28",
            "facet": "true",
            "wt": "json"
        }
    },
    "response": {
        "numFound": 5876,
        "start": 0,
        "docs": [
            // docs...
        ]
    },
    "facet_counts": {
        "facet_queries": {},
        "facet_fields": {},
        "facet_ranges": {},
        "facet_intervals": {},
        "facet_heatmaps": {
            "location_p": [
                "gridLevel",
                4,
                "columns",
                14,
                "rows",
                1,
                "minX",
                0.3515625,
                "maxX",
                5.2734375,
                "minY",
                51.50390625,
                "maxY",
                51.6796875,
                "counts_ints2D",
                [
                    // heatmap...
                ]
            ]
        }
    }
}

'facet_heatmaps' 中的边界(minX、maxY...)不等于 'params' 中传递的边界。有没有办法强制 Solr 按指定范围构建头图?

没有。没有办法强制 Solr 分面热图分面响应等于传入的确切边界。Solr 分面热图响应 returns 基于底层前缀树空间网格实现的分面计数的分面响应。

尝试更改 distErrPct 值或将 prefixTree 切换为 grid 以获得更精细的颗粒响应。

获取 Solr 文档:

You’ll experiment with different distErrPct values (probably 0.10 - 0.20) with various input geometries till the default size is what you’re looking for. The specific details of how it’s computed isn’t important. For high-detail grids used in point-plotting (loosely one cell per pixel), set distErr to be the number of decimal-degrees of several pixels or so of the map being displayed. Also, you probably don’t want to use a geohash based grid because the cell orientation between grid levels flip-flops between being square and rectangle. Quad is consistent and has more levels, albeit at the expense of a larger index.

https://lucene.apache.org/solr/guide/6_6/spatial-search.html#SpatialSearch-HeatmapFaceting