相关疑难解决方法(0)

弹性搜索双面

我想运行一个弹性搜索查询,它通过两个不同字段(纬度和经度)的组合对数据进行分组

curl -XGET http://www.my_server:9200/idx_occurrence/Occurrence/_search?pretty=true -d '{  
    "query": { 
        "query_string" : { 
            "fields" : ["genus_interpreted","dataset"], 
            "query": "Pica 2", 
            "default_operator" : "AND" 
         } 
    }, 
    "facets": { 
        "test": { 
            "terms": { 
                "fields" :["decimalLatitude","decimalLongitude"],
                "size" : 500000000 
            } 
        } 
    } 
}'
Run Code Online (Sandbox Code Playgroud)

它提供了比预期更多的结果......任何想法?

答案的相关部分越多......

_shards":{
    "total":5,
    "successful":5,
    "failed":0
},
"hits":{
    "total":**37**,
    "max_score":3.9314494,
    "hits":[{
Run Code Online (Sandbox Code Playgroud)

总命中数,37是查询的结果,如果我不应用方面.这个总数是方面总数的一半(见下文)

"facets":{
    "test":{
        "_type":"terms",
        "missing":0,
        "total":**74**,
        "other":0,
        "terms":[
           {"term":"167.21665954589844","count":5},
           {"term":"167.25","count":4},
           {"term":"167.14999389648438","count":4},
           {"term":"167.1041717529297","count":4},
           {"term":"-21.04166603088379","count":4},.....
Run Code Online (Sandbox Code Playgroud)

因此,分面分组是完全分开的(按纬度,然后是经度).

请注意,我不能仅按纬度或经度进行分组,因为多个记录可以共享纬度(但具有不同的经度)或反之亦然.

lucene elasticsearch

6
推荐指数
1
解决办法
2030
查看次数

标签 统计

elasticsearch ×1

lucene ×1