tencent cloud

Elasticsearch Service

User Guide
Release Notes and Announcements
Release Notes
Product Announcements
Security Announcement
Product Introduction
Overview
Elasticsearch Version Support Notes
Features
Elastic Stack (X-Pack)
Strengths
Scenarios
Capabilities and Restrictions
Related Concepts
Purchase Guide
Billing Overview
Pricing
Elasticsearch Service Serverless Pricing
Notes on Arrears
ES Kernel Enhancement
Kernel Release Notes
Targeted Routing Optimization
Compression Algorithm Optimization
FST Off-Heap Memory Optimization
Getting Started
Evaluation of Cluster Specification and Capacity Configuration
Creating Clusters
Accessing Clusters
ES Serverless Guide
Service Overview
Basic Concepts
5-Minute Quick Experience
Quick Start
Access Control
Writing Data
Data Query
Index Management
Alarm Management
ES API References
Related Issues
Data Application Guide
Data Application Overview
Data Management
Elasticsearch Guide
Managing Clusters
Access Control
Multi-AZ Cluster Deployment
Cluster Scaling
Cluster Configuration
Plugin Configuration
Monitoring and Alarming
Log Query
Data Backup
Upgrade
Practical Tutorial
Data Migration and Sync
Use Case Construction
Index Configuration
SQL Support
Receiving Watcher Alerts via WeCom Bot
API Documentation
History
Introduction
API Category
Instance APIs
Making API Requests
Data Types
Error Codes
FAQs
Product
ES Cluster
Service Level Agreement
Glossary
New Version Introduction
Elasticsearch Service July 2020 Release
Elasticsearch Service February 2020 Release
Elasticsearch Service December 2019 Release

Field Type Conversion Through Reindex

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-04 16:50:23

Overview

When you create an index in the ES Serverless service, a time field should be specified, and its type should be set to date. When you synchronize data from an existing ES cluster to an index in the ES Serverless service, if the field in the data has the same name as the time field but a different type, the write operation will fail. In this case, you can use the Reindex API to convert the field type.

Process Description

1. Create the target index for reindexing, and set the type of the field to date if the field has the same name as the time field in the ES Serverless service index.
2. Use the reindex API to synchronize the existing data to the target index.

Example

1. Suppose we need to synchronize data from the source_index to an index in the ES Serverless service (where the time field is @timestamp). Upon checking the field configuration of source_index, we find that in source_index, the field @timestamp is of type keyword. In this case, attempting to synchronize the data will result in a write error.

2. View the number of documents in source_index.

3. Create the target index dest_index for reindexing, and specify the type of the @timestamp field in the mapping as date.

4. Use the reindex API to synchronize data from source_index to dest_index, and the number of documents in dest_index should match exactly the number in the original source_index.
POST _reindex
{
"source": {
"index": "source_index"
},
"dest": {
"index": "dest_index"
}
}

5. In this case, searching dest_index will retrieve the data that was synchronized from source_index.



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백