ES _reindex实践初步总结

1、建立新索引

2、指定reindex

{
  "source": {
    "index": "deviceinfo_es"
  },
  "dest": {
    "index": "deviceinfo"
  }
}

结果如图:

3.2G,77万条数据,耗时526324毫秒,约10分钟。

参考:

https://blog.csdn.net/laoyang360/article/details/81589459

https://blog.csdn.net/qq_32923745/article/details/80827550

 

注:

1、建立新索引

{
  "mappings": {
    "appList": {
      "properties": {
        "app_ver": {
          "type": "string"
        },
        "apps": {
          "properties": {
            "app_label": {
              "type": "string"
            },
            "pkg_name": {
              "type": "string"
            }
          }
        },
        "biz_channel": {
          "type": "string"
        },
        "biz_type": {
          "type": "string"
        },
        "crawler_time": {
          "type": "string"
        },
        "imei": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "deviceInfo_td": {
      "properties": {
        "data": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "source": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "deviceInfo": {
      "properties": {
        "addition_tool": {
          "type": "string"
        },
        "app_ver": {
          "type": "string"
        },
        "basestation_count": {
          "type": "string"
        },
        "basestation_num": {
          "type": "string"
        },
        "biz_channel": {
          "type": "string"
        },
        "biz_type": {
          "type": "string"
        },
        "card_nettype": {
          "type": "string"
        },
        "client_version": {
          "type": "string"
        },
        "crawler_time": {
          "type": "string"
        },
        "distin_hight": {
          "type": "string"
        },
        "distin_width": {
          "type": "string"
        },
        "exist_simcard": {
          "type": "string"
        },
        "exist_wifi": {
          "type": "string"
        },
        "first_installtime": {
          "type": "string"
        },
        "frame_atttool": {
          "type": "string"
        },
        "gps_address": {
          "type": "string"
        },
        "imei": {
          "type": "string"
        },
        "imsi": {
          "type": "string"
        },
        "imsi1": {
          "type": "string"
        },
        "ip": {
          "type": "string"
        },
        "is_root": {
          "type": "string"
        },
        "last_updatetime": {
          "type": "string"
        },
        "latitude": {
          "type": "string"
        },
        "longitude": {
          "type": "string"
        },
        "mem": {
          "type": "string"
        },
        "mobile_coucode": {
          "type": "string"
        },
        "mobile_netcode": {
          "type": "string"
        },
        "network_type": {
          "type": "string"
        },
        "operation_mode": {
          "type": "string"
        },
        "os_type": {
          "type": "string"
        },
        "phone1": {
          "type": "string"
        },
        "phone_brand": {
          "type": "string"
        },
        "phone_model": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "route_mac": {
          "type": "string"
        },
        "router_ip": {
          "type": "string"
        },
        "router_name": {
          "type": "string"
        },
        "serial_number": {
          "type": "string"
        },
        "service_name": {
          "type": "string"
        },
        "ssid": {
          "type": "string"
        },
        "support_bluetooth": {
          "type": "string"
        },
        "support_callup": {
          "type": "string"
        },
        "support_mobnet": {
          "type": "string"
        },
        "support_nfc": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "use_simulator": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "callLog": {
      "properties": {
        "app_ver": {
          "type": "string"
        },
        "biz_channel": {
          "type": "string"
        },
        "biz_type": {
          "type": "string"
        },
        "crawler_time": {
          "type": "string"
        },
        "imei": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "records": {
          "properties": {
            "call_duration": {
              "type": "long"
            },
            "call_time": {
              "type": "string"
            },
            "call_type": {
              "type": "string"
            },
            "other_num": {
              "type": "string"
            }
          }
        },
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "smsList": {
      "properties": {
        "app_ver": {
          "type": "string"
        },
        "biz_channel": {
          "type": "string"
        },
        "biz_type": {
          "type": "string"
        },
        "crawler_time": {
          "type": "string"
        },
        "imei": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "records": {
          "properties": {
            "phone": {
              "type": "string"
            },
            "sms_time": {
              "type": "string"
            },
            "smsbody": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          }
        },
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    },
    "contact": {
      "properties": {
        "app_ver": {
          "type": "string"
        },
        "biz_channel": {
          "type": "string"
        },
        "biz_type": {
          "type": "string"
        },
        "crawler_time": {
          "type": "string"
        },
        "imei": {
          "type": "string"
        },
        "queryDate": {
          "type": "date",
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "records": {
          "properties": {
            "home_phone": {
              "type": "string"
            },
            "last_time_contacted": {
              "type": "string"
            },
            "last_updated_time": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "phone": {
              "type": "string"
            },
            "work_phone": {
              "type": "string"
            }
          }
        },
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      }
    }
  }
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Traceback (most recent call last): File "F:\pythonproject\ARIMA-GRACH\3.py", line 15, in <module> data = data.asfreq('D') File "E:\anaconda\lib\site-packages\pandas\core\frame.py", line 10517, in asfreq return super().asfreq( File "E:\anaconda\lib\site-packages\pandas\core\generic.py", line 7697, in asfreq return asfreq( File "E:\anaconda\lib\site-packages\pandas\core\resample.py", line 2096, in asfreq new_obj = obj.reindex(dti, method=method, fill_value=fill_value) File "E:\anaconda\lib\site-packages\pandas\util\_decorators.py", line 324, in wrapper return func(*args, **kwargs) File "E:\anaconda\lib\site-packages\pandas\core\frame.py", line 4804, in reindex return super().reindex(**kwargs) File "E:\anaconda\lib\site-packages\pandas\core\generic.py", line 4966, in reindex return self._reindex_axes( File "E:\anaconda\lib\site-packages\pandas\core\frame.py", line 4623, in _reindex_axes frame = frame._reindex_index( File "E:\anaconda\lib\site-packages\pandas\core\frame.py", line 4642, in _reindex_index return self._reindex_with_indexers( File "E:\anaconda\lib\site-packages\pandas\core\generic.py", line 5032, in _reindex_with_indexers new_data = new_data.reindex_indexer( File "E:\anaconda\lib\site-packages\pandas\core\internals\managers.py", line 679, in reindex_indexer self.axes[axis]._validate_can_reindex(indexer) File "E:\anaconda\lib\site-packages\pandas\core\indexes\base.py", line 4107, in _validate_can_reindex raise ValueError("cannot reindex on an axis with duplicate labels")
05-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值