- geometry_sector INTEGER
- );
-SELECT AddGeometryColumn('placex', 'geometry', 4326, 'GEOMETRY', 2);
-CREATE UNIQUE INDEX idx_place_id ON placex USING BTREE (place_id);
-CREATE INDEX idx_placex_osmid ON placex USING BTREE (osm_type, osm_id);
-CREATE INDEX idx_placex_rank_search ON placex USING BTREE (rank_search);
-CREATE INDEX idx_placex_rank_address ON placex USING BTREE (rank_address);
-CREATE INDEX idx_placex_geometry ON placex USING GIST (geometry);
-
---CREATE INDEX idx_placex_indexed ON placex USING BTREE (indexed);
-
-CREATE INDEX idx_placex_pending ON placex USING BTREE (rank_search) where indexed_status > 0;
-CREATE INDEX idx_placex_pendingsector ON placex USING BTREE (rank_search,geometry_sector) where indexed_status > 0;
-
---CREATE INDEX idx_placex_pendingbylatlon ON placex USING BTREE (geometry_index(geometry_sector,indexed,name),rank_search) where geometry_index(geometry_sector,indexed,name) IS NOT NULL;
-
-CREATE INDEX idx_placex_parent_place_id ON placex USING BTREE (parent_place_id) where parent_place_id IS NOT NULL;
-CREATE INDEX idx_placex_interpolation ON placex USING BTREE (geometry_sector) where indexed_status > 0 and class='place' and type='houses';
-
-CREATE INDEX idx_placex_sector ON placex USING BTREE (geometry_sector,rank_address,osm_type,osm_id);
-CLUSTER placex USING idx_placex_sector;
-
-DROP SEQUENCE seq_place;
+ geometry_sector INTEGER,
+ rank_address SMALLINT,
+ rank_search SMALLINT,
+ partition SMALLINT,
+ indexed_status SMALLINT,
+ LIKE place INCLUDING CONSTRAINTS,
+ wikipedia TEXT, -- calculated wikipedia article name (language:title)
+ country_code varchar(2),
+ housenumber TEXT,
+ postcode TEXT
+ ) {ts:search-data};
+SELECT AddGeometryColumn('placex', 'centroid', 4326, 'GEOMETRY', 2);
+CREATE UNIQUE INDEX idx_place_id ON placex USING BTREE (place_id) {ts:search-index};
+CREATE INDEX idx_placex_osmid ON placex USING BTREE (osm_type, osm_id) {ts:search-index};
+CREATE INDEX idx_placex_linked_place_id ON placex USING BTREE (linked_place_id) {ts:address-index} WHERE linked_place_id IS NOT NULL;
+CREATE INDEX idx_placex_rank_search ON placex USING BTREE (rank_search, geometry_sector) {ts:address-index};
+CREATE INDEX idx_placex_geometry ON placex USING GIST (geometry) {ts:search-index};
+CREATE INDEX idx_placex_adminname on placex USING BTREE (make_standard_name(name->'name'),rank_search) {ts:address-index} WHERE osm_type='N' and rank_search < 26;
+
+DROP SEQUENCE IF EXISTS seq_place;