elasticsearch,elasticutils,Django,elasticsearch,Elasticutils" /> elasticsearch,elasticutils,Django,elasticsearch,Elasticutils" />

Django Elasticsearch筛选器(数字字段)不返回任何内容 类型映射 查询全部:

Django Elasticsearch筛选器(数字字段)不返回任何内容 类型映射 查询全部:,django,elasticsearch,elasticutils,Django,elasticsearch,Elasticutils,返回: "hits": [ { "_index": "pois-en", "_type": "pois_poi", "_id": "491", "_score": 1, "fields": { "city": [ 91 ] } }, (...) 但当我使用以下方法进行过滤时: 它什么也不返回 我不知

返回:

"hits": [
     {
        "_index": "pois-en",
        "_type": "pois_poi",
        "_id": "491",
        "_score": 1,
        "fields": {
           "city": [
              91
           ]
        }
     },
     (...)
但当我使用以下方法进行过滤时: 它什么也不返回

我不知道我做错了什么。 对于Django和Elasticsearch通信,我是Elasticutils(),但我现在使用Sense来进行这些查询


提前感谢

类型名称在您的帖子中不一致(
poi
poi\u poi
)-返回的文档与您的映射不匹配。

我可以使用它。可能是您的类型名有问题,它在您的帖子中不一致(poi和poi_poi)?还有一个名为“type”的字段吗?您可以尝试删除它吗?谢谢。问题是post上的类型名称不一致。
GET pois-en/_search
{
  "query":{
    "match_all":{}
  },
  "fields": ["city"]
}
"hits": [
     {
        "_index": "pois-en",
        "_type": "pois_poi",
        "_id": "491",
        "_score": 1,
        "fields": {
           "city": [
              91
           ]
        }
     },
     (...)
GET pois-en/_search
{
    "query" : {
        "filtered" : { 
            "query" : {
                "match_all" : {} 
            },
            "filter" : {
                "term" : { 
                    "city" : 91
                }
            }
        }
    }
}