Skip to content

Commit cfc746b

Browse files
Search on label only; show 10 results instead of 4
1 parent ac37ad2 commit cfc746b

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

src/js/search.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,10 @@ function initSearchPopup(): SearchPopupObservable {
4444
}
4545

4646
export default function initSearch(filterManager: PlaceFilterManager): void {
47-
const places = Object.entries(filterManager.entries).map(
48-
([placeId, entry]) => ({
49-
value: placeId,
50-
label: placeId,
51-
customProperties: {
52-
place: entry.place.name,
53-
state: entry.place.state ?? "",
54-
country: entry.place.country,
55-
},
56-
}),
57-
);
47+
const places = Object.entries(filterManager.entries).map(([placeId]) => ({
48+
value: placeId,
49+
label: placeId,
50+
}));
5851
const htmlElement = document.querySelector(".search");
5952
if (!htmlElement) return;
6053

@@ -66,11 +59,8 @@ export default function initSearch(filterManager: PlaceFilterManager): void {
6659
allowHTML: false,
6760
itemSelectText: "",
6861
searchEnabled: true,
69-
searchFields: [
70-
"customProperties.place",
71-
"customProperties.state",
72-
"customProperties.country",
73-
],
62+
searchResultLimit: 10,
63+
searchFields: ["label"],
7464
});
7565

7666
// Set initial state.

0 commit comments

Comments
 (0)