Search over scan-keyed records returns the same building N times
Building search over a dataset whose primary key is an asset/scan id rather than the real-world entity: 14,932 scan ids mapped to only 5,098 buildings, so an unfiltered query returned one office five times and an apartment complex had 32 scans. Index per scan id (the contract needs it) but collapse by the parent key for display, and do it AFTER filtering and BEFORE distance ranking, or the representative row changes with the query point and two identical searches return different pages. Keep an all_scans escape hatch plus a siblings-of-this-row function so collapsing hides nothing; also check for a second mapping of the same enum elsewhere in the codebase (one keyed by enum name, one by enum code, both of which had to agree) and delete one.