ES index reconstruction method and storage medium
A technology of indexing and consumption groups, applied in the field of database search, can solve the problems of waiting for several hours to query the latest data, bad user experience, and users unable to search the latest data.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0067] Please refer to figure 2 , this embodiment provides an ES index rebuilding method, which brings users a senseless index rebuilding experience.
[0068] The method records the index operations on the old index through the message queue, and consumes queue messages to the new index for data appending after the new index is rebuilt, without stopping the use of the old index in the whole process.
[0069] The message queue involved in this embodiment is a dual consumer group, which can be a kafka topic, a rabbitmq topic or an activemq topic. In this embodiment, the kafka topic is used for illustration.
[0070] The methods include:
[0071] S1: Create a consumer group thread waiting to trigger consumption;
[0072] Specifically, create a thread corresponding to the consumption group new_group of the kafka topic, and the consumption mode of the consumption group is to consume messages only after being triggered.
[0073] S2: The index operation corresponding to the old ...
Embodiment corresponding Embodiment 1
[0090] This embodiment corresponds to Embodiment 1, and provides a specific application scenario:
[0091] The topic corresponding to Kafka is: topic_order, and the corresponding consumer group is: consumer_order_group;
[0092] The name of the old order index is: index_order, and the corresponding alias is: alias_order;
[0093] The new order index name is: index_order_new.
[0094] Methods include:
[0095] 1. The old order program queries the old order index index_order according to the alias_order, and writes the order data; at the same time, the newly added order data will also be written into the newly created consumer_order_group waiting to trigger consumption.
[0096] That is to say, after the transformation, the old order program can still query index_order according to the alias_order and write the order data. At this point, the order program also needs to write the order data into the topic_order topic of Kafka.
[0097] 2. Perform the operation of rebuilding t...
Embodiment 3
[0108] This embodiment corresponds to Embodiment 1, and provides another specific application scenario:
[0109] Business scenario (order):
[0110] In large-scale e-commerce platforms, user order data is often stored in the order index order in elasticsearh, and this part of data may reach more than one billion pieces of data, occupying 2 to 3T of disk space. By utilizing the distributed search feature of elasticsearch, users can search for their own orders among more than one billion orders within milliseconds.
[0111] Business needs:
[0112] Some users of online orders reported that the order cannot be searched.
[0113] Technical solution:
[0114] Because there is a problem with the field mapping setting of the online order index, users cannot search for the correct order. However, there are already more than one billion pieces of data in online orders, and the conventional index rebuilding scheme will cause users to not be able to search for the latest orders withi...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


