Elasticsearch范围查询中的负值

时间:2018-06-14 07:21:20

标签: elasticsearch elastic-stack

我在Elasticsearch中制作手表时发现了这个问题,这是我的疑问:

"body": {
  "query": {
    "bool": {
      "must": [
        {
        "range": {
          "percent": {
            "lt": 100
          }

它成功返回每个文档,其中百分比介于0到99之间,但是忽略那些具有负值的文档。 "百分比"字段在索引中映射为长数。

你能帮帮我吗? 感谢

编辑:返回执行" curl -XGET localhost:9200 / monthly-tickets-2018-06"

{
  "monthly-tickets-2018-06": {
    "aliases": {},
    "mappings": {
      "monthly_tickets": {
        "properties": {
          "percent": {
            "type": "long"
          },
          "priority": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "project": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "ref": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            }
          },
          "timestamp": {
            "type": "date"
          }
        }
      }
    },
    "settings": {
      "index": {
        "creation_date": "1528946562231",
        "number_of_shards": "5",
        "number_of_replicas": "1",
        "uuid": "aIfLjFwqS_aCzQFvZm0L5Q",
        "version": {
          "created": "6020399"
        },
        "provided_name": "monthly-tickets-2018-06"
      }
    }
  }
}

0 个答案:

没有答案