簡體   English   中英

elasticsearch 查詢 GCP alpha 和 beta api

[英]elasticsearch query for GCP alpha and beta api's

試圖讓下面的查詢在 GCP 上工作。 需要它來查詢每 24 小時使用一次的 beta api。 不斷在查詢中出錯。 可能是一個簡單的語法錯誤,但我沒有看到它。

    GET /gcp-%2A/_search
{
    "query": {
          "range" : {
            "timestamp" : {
                "gte" : "now-1d/d",
                "lt" :  "now/d"
            }
        },
            "wildcard": {
            "protoPayload.methodName": {
                "value": "*beta*",
                "boost": 1.0,
                "rewrite": "constant_score"
            }
        }
    }
}
{
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[range] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
        "line": 9,
        "col": 13
      }
    ],
    "type": "parsing_exception",
    "reason": "[range] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
    "line": 9,
    "col": 13
  },
  "status": 400
}

你幾乎在那里:

GET /gcp-%2A/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "timestamp": {
              "gte": "now-1d/d",
              "lt": "now/d"
            }
          }
        },
        {
          "wildcard": {
            "protoPayload.methodName": {
              "value": "*beta*",
              "boost": 1,
              "rewrite": "constant_score"
            }
          }
        }
      ]
    }
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM