Last active
December 15, 2015 20:09
-
-
Save mmcfarland/5316089 to your computer and use it in GitHub Desktop.
dor parcel shp2pgsql -> autocomplete searchable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alter table dor_parcels add column full_address varchar(500); | |
update dor_parcels set full_address = coalesce(house, 0) || ' ' || coalesce(stdir, '') || ' ' || coalesce(stnam, '') || ' ' || coalesce(stdes, ''); | |
create index parcel_addr_idx on dor_parcels (full_address); | |
alter table dor_parcels add column ts_f_address tsvector; | |
update dor_parcels set ts_f_address = to_tsvector('english', coalesce(full_address,'')); | |
create index textsearch_address on dor_parcels using gin(ts_f_address); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment