
Guide to Reindexing and Adding Cities in Elasticsearch
A comprehensive guide on how to reindex and add new cities in Elasticsearch. The article covers everything from deleting indexes to connecting to the GIS database and launching the search service.
In this guide, we'll learn how to manage index settings and data in Kibana for efficient data indexing and retrieval. By navigating through the stack management and index management menus, we can view and manipulate various indexes such as address index, region ID, street index, and street index ID.
Reindexing Data
If you need to reindex specific data like the address index region 1, you'll learn how to delete and reconfigure indexes effectively.
Modifying Network Settings
Explore the network settings file for city indexing configurations, presented in a JSON format. You'll understand how to add new cities for indexing by copying and editing JSON entries.
Connecting to GIS Database
Discover the process of connecting to a GIS database, locating the necessary information like city IDs from the S_CITY table, and linking to Elasticsearch for data retrieval.
Indexing Cities and Streets
Execute the indexing process by launching the search service, running the cdindex application, and selecting cities and streets for indexing. Monitor the progress and ensure successful indexing of data for seamless retrieval in Kibana.
Let's get started.
To start, go to the browser and enter port 5601, which is the address, for example,




13

5601 is the address of the cyber


Next, go to the menu, stack management, and index management.



We see all the indices we have.


The following indexes are address index, address index and region ID, as well as street index and street index ID region.

Let's say we want to reindex the address index of region 1, meaning we need to remove address index 1 and street index 1.




To delete indexes, select delete, confirm, indexes removed.




Next, we move to the network setting file. This file contains the indexing settings for cities, so it looks like this, a standard JSON file.






For example, we want to add another city to index it.

For example, we can copy the lines of one city in quotation marks, then be sure to add a comma.


We have copied, now we can name it, let it be called some district town, it doesn't matter, here the correct OSMID is important, that is, there must be a positive OSMID, there is a negative one, that is, if it's negative, then we write it as negative.




Next, connecting to the GIS database, which means that in some years it is located where the database is, in others it is located where our services are found, we will need to find out.

For example, here are
Next, the region is the city ID from the S_CITY table. We check which city ID is there. If the city is 1, for example, like Astana, it will have a one there, usually the IDs sound like 1006. Enter the city ID here. The next link is for Elasticsearch, where Elasticsearch is located, in this case, 3.




Here is the refined text: Here it is, save this file. Next, launch the search service, which is the host for sending to Elastic, and start the indexing application, cdindex. It reads this file, provides a list of available cities. Let's take, for example, 4 that have been created. Enter them one by one, check the settings. If everything is correct and selected properly, press and wait for the indexing process. Streets have been added, districts will be selected next. It is visible that out of 514 streets found, all 514 have been added. Now, all houses are being selected. Everything is ready, 100% added. We can close it. Open our Kibana, press the "reindex" button, and see that a side district has been created with the address index and cdindex containing the necessary amount. That's all.









