ES重新索引忽略新映射

时间:2020-01-23 18:58:22

标签: elasticsearch-5

在python elasticsearch中重新索引时,在查询时返回正确的映射(/ _mapping?pretty),但是重新索引的数据(以及现在出现的新数据)将忽略声明的类型(“ type”:“ float ”),并作为字符串输入。我确实用具有正确映射的新索引替换了旧索引,并重新索引了所有旧数据。 旧映射

              "storeLocationID" : {
                "type" : "text",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "transactionAmount" : {
                "type" : "float",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "transactionID" : {
                "type" : "text",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              } 

新映射

             "storeLocationID" : {
                "type" : "text",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },
              "transactionAmount" : {
                "type" : "float"
              },
              "transactionID" : {
                "type" : "text",
                "norms" : false,
                "fields" : {
                  "keyword" : {
                    "type" : "keyword",
                    "ignore_above" : 256
                  }
                }
              },

但是,索引中的数据仍然看起来像这样:

    "payload": {
      "endTime": "2020-01-21T23:58:58-05:00",
      "startTime": "2020-01-21T23:58:57-05:00",
      "hasPriceOverride": false,
      "registerID": "3",
      "hasVoidedItem": false,
      "storeLocationID": "1255",
      "version": "1.1",
      "siteId": "143654",
      "cashierID": "9563749",
      "hasNetworkAuthTender": false,
      "transactionID": "3951",
      "transactionType": "Sale",
      "transactionAmount": "5",
      "hasRestrictedItem": false
    }

0 个答案:

没有答案