Skip to content

Commit 9cec07b

Browse files
authored
Merge pull request #705 from geoadmin/develop-2026-02-04
New Release 2026-02-04-rc1
2 parents 554c8e4 + 9842925 commit 9cec07b

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,37 @@ The swisssearch index (zipcodes) has to be computed after a wordforms update.
8484
cd test
8585
python test.py -h localhost -p 9312 -i swisssearch "birgmattenweg 5"
8686
```
87+
88+
### Command line debugging with MYSQL interface
89+
You can access the Sphinx indexes using the MySQL client from inside the Sphinx pods.
90+
First, open a bash terminal inside a Sphinx container.
91+
```bash
92+
$ kubectx bgdi/dev
93+
$ kubectl -n service-search exec -it service-search-0 -c sphinx -- bash
94+
$ mysql -h 127.0.0.1 -P 9306
95+
96+
$ MySQL [(none)]> select count(*) FROM ch_swisstopo_swissboundaries3d_gemeinde_flaeche_fill;
97+
+----------+
98+
| count(*) |
99+
+----------+
100+
| 546474 |
101+
+----------+
102+
1 row in set (0.009 sec)
103+
104+
# expanded output for better readability
105+
MySQL [(none)]> select * FROM ch_swisstopo_swissboundaries3d_gemeinde_flaeche_fill limit 1\G
106+
*************************** 1. row ***************************
107+
id: 1
108+
origin: feature
109+
detail: aeugst am albis 1
110+
layer: ch.swisstopo.swissboundaries3d-gemeinde-flaeche.fill
111+
geom_quadindex: 0300210
112+
lat: 47.274960
113+
lon: 8.490504
114+
geom_st_box2d: BOX(678109.8793882465 234561.19507542154,681154.069340285 238543.8333016288)
115+
geom_st_box2d_lv95: BOX(2678110.6950000003 1234561.039999999,2681154.916000001 1238543.664999999)
116+
label: Aeugst am Albis 2026
117+
year: 2026
118+
feature_id: 1
119+
1 row in set (0.008 sec)
120+
```

conf/search.conf.part

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ source src_swisssearch : def_pqsql
55
sql_attr_uint = num
66
sql_attr_uint = rank
77
sql_attr_uint = zoomlevel
8+
sql_attr_uint = egaid
89
sql_attr_string = label
910
sql_attr_string = objectclass
1011
sql_attr_string = feature_id
1112
sql_attr_string = origin
1213
sql_attr_string = geom_st_box2d
1314
sql_attr_string = geom_st_box2d_lv95
15+
sql_attr_string = egid_edid
1416
sql_attr_float = x
1517
sql_attr_float = y
1618
sql_attr_float = x_lv95
@@ -43,6 +45,8 @@ source src_address : src_swisssearch
4345
, st_x(st_transform(the_geom,4326)) as lon \
4446
, NULLIF(regexp_replace(adr_number::text, '[^0-9]'::text, ''::text, 'g'::text), ''::text)::integer AS num \
4547
, 10 as zoomlevel \
48+
, adr_egaid as egaid \
49+
, legacy_id as egid_edid \
4650
FROM vd.addressverzeichnis
4751
}
4852

@@ -68,6 +72,8 @@ source src_parcel : src_swisssearch
6872
, st_x(st_transform(the_geom_point,4326)) as lon \
6973
, num \
7074
, 10 as zoomlevel \
75+
, NULL as egaid \
76+
, NULL as egid_edid \
7177
from vd.parzellen_sphinx
7278
}
7379

@@ -178,7 +184,9 @@ source src_swissnames3d : src_swisssearch
178184
coalesce(b.lat,s.lat) as lat, \
179185
coalesce(b.lon,s.lon) as lon, \
180186
1 as num, \
181-
coalesce(b.zoomlevel,s.zoomlevel) as zoomlevel \
187+
coalesce(b.zoomlevel,s.zoomlevel) as zoomlevel, \
188+
NULL as egaid, \
189+
NULL as egid_edid \
182190
FROM swissnames_search s \
183191
left outer join tlm.dkm_search b ON s.feature_id = b.feature_id \
184192
UNION ALL \
@@ -199,7 +207,9 @@ source src_swissnames3d : src_swisssearch
199207
b.lat as lat, \
200208
b.lon as lon, \
201209
1 as num, \
202-
b.zoomlevel as zoomlevel \
210+
b.zoomlevel as zoomlevel, \
211+
NULL as egaid, \
212+
NULL as egid_edid \
203213
FROM swissnames_search s \
204214
inner join tlm.dkm_search b on s.name = b.name and s.objectclass = 'TLM_GEBAEUDE' and s.feature_id <> b.feature_id \
205215
) s
@@ -228,6 +238,8 @@ source src_gg25 : src_swisssearch
228238
, st_x(st_transform(ST_PointOnSurface(g.the_geom),4326)) as lon \
229239
, -1 as zoomlevel \
230240
, 1 as num \
241+
, NULL as egaid \
242+
, NULL as egid_edid \
231243
FROM tlm.swissboundaries_gemeinden_uebersetzt g left join tlm.swissboundaries_kantone k on k.kantonsnr = g.kantonsnr
232244
}
233245

@@ -254,6 +266,8 @@ source src_kantone : src_swisssearch
254266
, st_x(st_transform(ST_PointOnSurface(the_geom),4326)) as lon \
255267
, -1 as zoomlevel \
256268
, 1 as num \
269+
, NULL as egaid \
270+
, NULL as egid_edid \
257271
FROM tlm.swissboundaries_kantone
258272
}
259273

@@ -280,6 +294,8 @@ source src_district : src_swisssearch
280294
, st_x(st_transform(ST_PointOnSurface(the_geom),4326)) as lon \
281295
, -1 as zoomlevel \
282296
, 1 as num \
297+
, NULL as egaid \
298+
, NULL as egid_edid \
283299
FROM tlm.swissboundaries_bezirke
284300
}
285301

@@ -306,6 +322,8 @@ source src_zipcode : src_swisssearch
306322
, st_x(st_transform(ST_PointOnSurface(the_geom),4326)) as lon \
307323
, -1 as zoomlevel \
308324
, 1 as num \
325+
, NULL as egaid \
326+
, NULL as egid_edid \
309327
FROM vd.amtovz_ortschaften p
310328
}
311329

@@ -332,6 +350,8 @@ source src_haltestellen : src_swisssearch
332350
, st_x(st_transform(st_geometryn(the_geom,1),4326)) as lon \
333351
, -1 as zoomlevel \
334352
, 1 as num \
353+
, NULL as egaid \
354+
, NULL as egid_edid \
335355
FROM bav.oev_haltestellen
336356
}
337357

conf/stopo.conf.part

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ source src_ch_swisstopo_amtliches_gebaeudeadressverzeichnis : def_searchable_fea
684684
SELECT adr_egaid as id \
685685
, concat_ws(' ', stn_label, adr_number, zip_label) as label \
686686
, 'feature' as origin \
687-
, remove_accents(concat_ws(' ', adr_egaid, bdg_egid, adr_edid, str_esid, stn_label, adr_number, com_name)) as detail \
687+
, remove_accents(concat_ws(' ', adr_egaid, bdg_egid, adr_edid, str_esid, stn_label, adr_number, com_name, legacy_id)) as detail \
688688
, 'ch.swisstopo.amtliches-gebaeudeadressverzeichnis' as layer \
689689
, geom_quadindex \
690690
, st_y(st_transform(ST_PointOnSurface(the_geom),4326)) as lat \

conf/vbs.conf.part

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ source src_ch_vbs_schiessanzeigen : def_searchable_features
134134
SELECT belplan_id as id \
135135
, bezeichnung as label \
136136
, 'feature' as origin \
137-
, remove_accents(concat_ws(' ', bezeichnung, belplan_id)) as detail \
137+
, remove_accents(concat_ws(' ', bezeichnung, belplan_id, belplan_ort_id, bezeichnung_ort)) as detail \
138138
, 'ch.vbs.schiessanzeigen' as layer \
139139
, quadindex(the_geom) as geom_quadindex \
140140
, st_y(st_transform(st_centroid(the_geom),4326)) as lat \
141141
, st_x(st_transform(st_centroid(the_geom),4326)) as lon \
142142
, box2d(st_transform(the_geom, 21781)) as geom_st_box2d \
143143
, box2d(st_transform(the_geom, 2056)) as geom_st_box2d_lv95 \
144144
, belplan_id::text as feature_id \
145-
from public.schiessanzeigen
145+
from public.view_schiessanzeigen
146146
}
147147

148148

0 commit comments

Comments
 (0)