Icon

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.

By Dmitry Lugovoy

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,

1
Click here
2
Drag "192.168.3.13:5601/app/home#/"
3
Click "192.168.3.13:5601/app/home#/"
4
Click "192.168.3.13:5601/app/home#/"

13

5
Click "192.168.3.13:5601/app/home#/"

5601 is the address of the cyber

6
Click here
7
Click here

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

8
Click here
9
Click here
10
Click "Stack Management"

We see all the indices we have.

11
Click "Index Management"
12
Click here

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

13
Click here

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.

14
Click here
15
Click here
16
Click here
17
Click here

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

18
Click "Manage 2 indices"
19
Click "Delete indices"
20
Click "Delete indices"
21
Click here

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.

22
Click here
23
Click here
24
Click "SettingsCity.json"
25
Click here
26
Drag "{"
27
Click here

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

28
Click "" Elastic ""

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

29
Drag here
30
Click "|"

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.

31
Double-click "} ,"
32
Double-click "" Алматы"
33
Click "Район ""
34
Drag "" -3072001 " ,"

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.

35
Click "|"

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.

36
Click "" Region ""
37
Click "" ConnectStringOSM ""
38
Drag "" http://192.168.3.13:9200 ""
39
Click here

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.

40
Click "" ConnectStringOSM " : " Host - 192.168.3.13 ; Port - 5432 ; Database - gis ; Username - renderer ; Password = renderer " Region " : 3 ,"
41
Click "|"
42
Click "Файл"
43
Click "Сохранить"
44
Click "Search.exe"
45
Double-click "Search.exe"
46
Double-click "CityIndex.exe"
47
Drag here
48
Click "Reload indices"

49
Click here

Guide to Reindexing and Adding Cities in Elasticsearch