- -- Special case - if we are just adding extra words we hack them into the search_name table rather than reindexing
- IF FALSE AND existingplacex.rank_search < 26
- AND coalesce(existing.housenumber, '') = coalesce(NEW.housenumber, '')
- AND coalesce(existing.street, '') = coalesce(NEW.street, '')
- AND coalesce(existing.addr_place, '') = coalesce(NEW.addr_place, '')
- AND coalesce(existing.isin, '') = coalesce(NEW.isin, '')
- AND coalesce(existing.postcode, '') = coalesce(NEW.postcode, '')
- AND coalesce(existing.country_code, '') = coalesce(NEW.country_code, '')
- AND coalesce(existing.name::text, '') != coalesce(NEW.name::text, '')
- THEN
-
- IF NOT update_location_nameonly(existingplacex.place_id, NEW.name) THEN
-
- IF st_area(NEW.geometry) < 0.5 THEN
- UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id
- and placex.place_id = place_addressline.place_id and indexed_status = 0
- and (rank_search < 28 or name is not null);
- END IF;
-
- END IF;
-
- ELSE
-
- -- Anything else has changed - reindex the lot
- IF coalesce(existing.name::text, '') != coalesce(NEW.name::text, '')
- OR coalesce(existing.housenumber, '') != coalesce(NEW.housenumber, '')
- OR coalesce(existing.street, '') != coalesce(NEW.street, '')
- OR coalesce(existing.addr_place, '') != coalesce(NEW.addr_place, '')
- OR coalesce(existing.isin, '') != coalesce(NEW.isin, '')
- OR coalesce(existing.postcode, '') != coalesce(NEW.postcode, '')
- OR coalesce(existing.country_code, '') != coalesce(NEW.country_code, '') THEN
-
- -- performance, can't take the load of re-indexing a whole country / huge area
- IF st_area(NEW.geometry) < 0.5 THEN
--- UPDATE placex set indexed_status = 2 from place_addressline where address_place_id = existingplacex.place_id
--- and placex.place_id = place_addressline.place_id and indexed_status = 0;
- END IF;
-
- END IF;