簡體   English   中英

范圍字符串為整數

[英]Range string as integer

假設我們有Post索引,它具有嵌套參數字段,具有嚴格的映射並具有以下結構

    "parameters": {
        "type": "nested",
        "dynamic": "strict",
        "properties": {
          "kind": {
            "type": "text",
            "include_in_all": false
          },
          "label": {
            "type": "text",
            "include_in_all": false
          },
          "name": {
            "type": "text",
            "include_in_all": false
          },
          "option_id": {
            "type": "text",
            "include_in_all": false
          },
          "value": {
            "type": "text",
            "include_in_all": true
          }
        }
      },

Value屬性可以處理integer,float和string值。 但是,現在我必須通過parameters.value過濾帖子,特別是使用范圍查詢 (parameters.value> $ needs_value)。 我試圖使用范圍查詢 根據文檔 參數。值將按字典順序過濾。 但我需要搜索整數。 那么我該怎樣做才能到達我的針頭。

我認為唯一自然的方法是在不同的屬性中索引不同的類型。 您可以使用https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html

暫無
暫無

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

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