diff --git a/cadastre/cadastre_import.py b/cadastre/cadastre_import.py index f2b8500b..0791237b 100644 --- a/cadastre/cadastre_import.py +++ b/cadastre/cadastre_import.py @@ -863,6 +863,9 @@ def endImport(self): DROP INDEX IF EXISTS geo_batiment_centroide_geom_idx; CREATE INDEX geo_parcelle_centroide_geom_idx ON geo_parcelle USING gist (ST_Centroid(geom)); CREATE INDEX geo_batiment_centroide_geom_idx ON geo_batiment USING gist (ST_Centroid(geom)); + DROP INDEX IF EXISTS parcelle_info_voie_substr_idx; + CREATE INDEX parcelle_info_voie_substr_idx + ON parcelle_info ((SUBSTR(voie,0,7)||SUBSTR(voie,12,4))); ''' sql = CadastreCommon.setSearchPath(sql, self.dialog.schema) self.executeSqlQuery(sql) diff --git a/cadastre/dialogs/search_dialog.py b/cadastre/dialogs/search_dialog.py index 45d4fed5..bc392375 100644 --- a/cadastre/dialogs/search_dialog.py +++ b/cadastre/dialogs/search_dialog.py @@ -744,7 +744,7 @@ def refreshAutocomplete(self, key): def getFeaturesFromSqlQuery(self, layer, filterExpression=None, attributes='*', orderBy=None): """ Get data from a db table, - optionnally filtered by given expression + optionally filtered by given expression and get corresponding QgsFeature objects """ QApplication.setOverrideCursor(Qt.WaitCursor) @@ -855,7 +855,7 @@ def onSearchItemChoose(self, key, label, value): QApplication.restoreOverrideCursor() return None - # Set filter expression for parcell child data + # Set filter expression for parcelle child data ckey = self.searchComboBoxes[key]['search']['parcelle_child'] if key == 'adresse': filterExpression = "SUBSTR(voie,0,7)||SUBSTR(voie,12,4) = '%s%s'" % (value['voie'][0:6], value['voie'][11:])