Add full-text search #20

Merged
raucao merged 28 commits from feature/10-fulltext_search into master 2026-02-24 11:03:57 +00:00
2 changed files with 24 additions and 7 deletions
Showing only changes of commit 361a826e4f - Show all commits

View File

@@ -83,7 +83,7 @@ export default class PlaceDetails extends Component {
}
parts.push(city);
}
// State + Country (if not already covered)
const state = get('addr:state', 'state');
const country = get('addr:country', 'country');
@@ -151,7 +151,7 @@ export default class PlaceDetails extends Component {
if (!id) return null;
return `https://www.google.com/maps/search/?api=1&query=${this.name}&query=${this.place.lat},${this.place.lon}`;
}
get showDescription() {
// If it's a Photon result, the description IS the address.
// Since we are showing the address in the meta section (bottom),

View File

@@ -24,14 +24,31 @@ export default class OsmService extends Service {
this.controller = new AbortController();
const signal = this.controller.signal;
const typeKeys = [
'amenity',
'amenity',
'shop',
'tourism',
'historic',
'leisure',
'office',
'craft',
'building',
'landuse',
'public_transport',
'aeroway'
]
const typeKeysQuery = [`~"^(${typeKeys.join("|")})$"~".*"`];
const query = `
[out:json][timeout:25];
(
nw["amenity"](around:${radius},${lat},${lon});
nw["shop"](around:${radius},${lat},${lon});
nw["tourism"](around:${radius},${lat},${lon});
nw["leisure"](around:${radius},${lat},${lon});
nw["historic"](around:${radius},${lat},${lon});
node(around:${radius},${lat},${lon})
[${typeKeysQuery}][name~"."];
way(around:${radius},${lat},${lon})
[${typeKeysQuery}][name~"."];
relation(around:${radius},${lat},${lon})
[${typeKeysQuery}][name~"."];
);
out center;
`.trim();