<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Tripmap Engineering]]></title><description><![CDATA[How Tripmap builds destination discovery, maps and trip planning for Vietnam, with engineering notes on geospatial data, multilingual search, AI and MCP.]]></description><link>https://tripmap.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6b0fe0b238f42d1698e537a8/91240ce6-b29a-45d0-bcc0-0500482d0333.png</url><title>Tripmap Engineering</title><link>https://tripmap.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 22:17:11 GMT</lastBuildDate><atom:link href="https://tripmap.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Retrying Reservation Requests Without Duplicates]]></title><description><![CDATA[Use retry keys, atomic writes, and reconciliation to prevent duplicate reservations after a timeout or concurrent request.]]></description><link>https://tripmap.hashnode.dev/retrying-reservation-requests-without-duplicates</link><guid isPermaLink="true">https://tripmap.hashnode.dev/retrying-reservation-requests-without-duplicates</guid><category><![CDATA[api]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:11:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0fe0b238f42d1698e537a8/4f052bc1-d78a-4994-ba58-c4bd8972c74f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A traveler reserves two spots on a guided excursion. The server commits the reservation just before the phone loses its connection. The traveler taps <strong>Try again</strong> when the connection comes back. To the phone, the first attempt looks like a failure. To the server, the second request must refer to the same booking intent. This article uses a fictional reservation API. <a href="https://tripmap.vn/en/experiences">Tripmap local experiences</a></p>
<h2>Give the booking intent an identity</h2>
<p>Generate an idempotency key once when the traveler confirms the reservation. Send it with the initial request and reuse it when retrying the same intent. A new, deliberate reservation gets a new key. This lets the server distinguish two requests that share a payload because one is a retry from two bookings for the same excursion.</p>
<pre><code class="language-http">POST /reservations HTTP/1.1
Content-Type: application/json
Idempotency-Key: 347a8420-223c-45f4-92b8-f7bd40b8d17b

{"experienceId":"walk-17","partySize":2}
</code></pre>
<p>The header name is part of the contract for this example. Clients should retry a non-idempotent request only when the API documents how the retry is safe or the client can determine the first attempt did not apply. <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2">HTTP Semantics, section 9.2.2</a></p>
<h2>Make the server enforce the promise</h2>
<p>Scope the key to the authenticated caller and the operation. Store a fingerprint of the accepted payload and the reservation reference. Enforce uniqueness on the scoped key at the database level. With a single database, commit the reservation and the replayable result together in one transaction. A second request arriving at the same time then has one owner to wait for or one in-progress operation to report.</p>
<table>
<thead>
<tr>
<th>What the server sees</th>
<th>One possible API response</th>
</tr>
</thead>
<tbody><tr>
<td>New key and valid payload</td>
<td>Create the reservation and return its reference.</td>
</tr>
<tr>
<td>Completed key and matching payload</td>
<td>Return the existing reservation reference.</td>
</tr>
<tr>
<td>In-progress key and matching payload</td>
<td>Report that the operation is pending and give the client a way to check.</td>
</tr>
<tr>
<td>Known key and different payload</td>
<td>Reject the conflicting reuse.</td>
</tr>
</tbody></table>
<p>Publish how long keys remain valid. If a retry arrives after the retention window, give the traveler a way to check for an existing reservation before they submit again.</p>
<h2>Reconcile requests that reach another provider</h2>
<p>A local transaction cannot cover a remote provider call. When a provider accepts its own idempotency key, pass a stable operation identifier and retain the mapping. If a call times out, look up the operation through a provider reference where the provider supports it. An unresolved outcome belongs in a pending or reconciliation state until the system can establish whether the reservation exists.</p>
<h2>Test the failure after the write</h2>
<p>Drop the response immediately after the database commits, then send the same request again. Assert that both attempts refer to one reservation. Repeat with two simultaneous requests and with a different payload under the same key. Finally, simulate a provider timeout and check that uncertainty stays visible to the traveler while the system resolves it.</p>
]]></content:encoded></item><item><title><![CDATA[Designing Accessible Map and List Interfaces]]></title><description><![CDATA[Build a usable map and results list with keyboard controls, stable focus, and concise status announcements after updates.]]></description><link>https://tripmap.hashnode.dev/designing-accessible-map-and-list-interfaces</link><guid isPermaLink="true">https://tripmap.hashnode.dev/designing-accessible-map-and-list-interfaces</guid><category><![CDATA[Accessibility]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:11:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0fe0b238f42d1698e537a8/4dc8d74a-778d-4209-bdef-3758cf193fa3.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A traveler opens a map of nearby sights, tabs past two zoom controls, and still cannot choose a place. The map works with a mouse, but the list fails to expose the same result-selection task. A map-based itinerary gives us a useful context to design around. The interface below is an illustrative example. <a href="https://tripmap.vn/en/my-trips">Tripmap itinerary planner</a></p>
<h2>Give the list the same place-selection task</h2>
<p>Expose each result in a real list. Use a link for opening a detail page and a button for an action such as selecting a result on the map. Include enough context in the row to distinguish similar names, such as a neighborhood and a category. The list should let someone find a place, open its details, and return to the results using the keyboard. <a href="https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html">WCAG guidance on keyboard access</a></p>
<p>If searching by visible area is central to the product, also provide a way to choose an area without dragging the map. A labeled neighborhood selector or named pan and zoom controls can make that task available to more people. Use a consistent visual highlight when a place is selected in either view.</p>
<h2>Keep focus stable when results update</h2>
<p>When someone activates <strong>Search this area</strong>, keep focus on the control as long as it remains available. Update the list, show the new count visibly, and announce the count through a status region already present in the DOM. This lets screen reader users hear that the results changed without having their focus moved to the first item. <a href="https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html">WCAG guidance on status messages</a></p>
<pre><code class="language-html">&lt;section aria-labelledby="places-heading"&gt;
  &lt;h2 id="places-heading"&gt;Places in this area&lt;/h2&gt;
  &lt;button type="button" id="search-area"&gt;Search this area&lt;/button&gt;
  &lt;p role="status" id="places-status"&gt;&lt;/p&gt;
  &lt;ul id="places-list"&gt;&lt;/ul&gt;
&lt;/section&gt;
</code></pre>
<p>After a successful refresh, replace the list items and set the status text to something like “8 places in this area.” Use a concise message when a search comes back empty. If you close a modal details view, return focus to the control that opened it where possible, or to a nearby results control if that item disappeared.</p>
<h2>Test the task from start to finish</h2>
<ol>
<li>Use only the keyboard to set an area, find a place, open its details, and get back to the list.</li>
<li>Refresh results while focus is on the search button. Confirm that the focus stays visible and the new result count is announced once.</li>
<li>Repeat with a screen reader and an empty result set. Check that the next available action is clear.</li>
<li>Select a result from the list and from the map. Both actions should refer to the same place.</li>
</ol>
<p>Test the whole sequence as a traveler would use it. A page can pass a markup check and still make it hard to recover your place after an update.</p>
]]></content:encoded></item><item><title><![CDATA[Validating GeoJSON Points Before Drawing a Map]]></title><description><![CDATA[Validate GeoJSON point structure and coordinate bounds, then flag valid-looking entries that fall outside the intended coverage.]]></description><link>https://tripmap.hashnode.dev/validating-geojson-points-before-drawing-a-map</link><guid isPermaLink="true">https://tripmap.hashnode.dev/validating-geojson-points-before-drawing-a-map</guid><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:11:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0fe0b238f42d1698e537a8/380704e8-d0dd-4852-b1a2-2855d882a847.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A travel guide imports a batch of places and one marker lands far from its destination. The import had accepted every coordinate pair because both values were numbers. Maps for planning a trip make the consequence immediate: one misplaced marker can make an otherwise useful route hard to trust. The records in this example are invented. <a href="https://tripmap.vn/en/my-trips">Tripmap itinerary planner</a></p>
<h2>Validate the GeoJSON contract first</h2>
<p>A GeoJSON point puts longitude first and latitude second, in decimal degrees. Some source interfaces label fields in the opposite order. Convert between the two at the import boundary, where the source format is still known, and keep the order consistent within your GeoJSON data. <a href="https://www.rfc-editor.org/rfc/rfc7946.html#section-3.1.1">RFC 7946, GeoJSON positions</a></p>
<p>This example accepts the two- and three-value positions used by a simple place importer. It checks that the values are finite and that longitude and latitude lie within their usual geographic ranges.</p>
<pre><code class="language-js">function isGeoJsonPoint(geometry) {
  if (geometry?.type !== "Point" || !Array.isArray(geometry.coordinates)) {
    return false;
  }

  const { coordinates } = geometry;
  if (coordinates.length !== 2 &amp;&amp; coordinates.length !== 3) return false;

  const [longitude, latitude] = coordinates;
  return Array.from(coordinates).every(Number.isFinite)
    &amp;&amp; longitude &gt;= -180 &amp;&amp; longitude &lt;= 180
    &amp;&amp; latitude &gt;= -90 &amp;&amp; latitude &lt;= 90;
}
</code></pre>
<table>
<thead>
<tr>
<th>Coordinates</th>
<th>Validation result</th>
</tr>
</thead>
<tbody><tr>
<td><code>[108.2, 16.1]</code></td>
<td>Passes the structural and range checks.</td>
</tr>
<tr>
<td><code>[16.1, 108.2]</code></td>
<td>Fails because the latitude is above 90°.</td>
</tr>
<tr>
<td><code>[48.9, 2.3]</code></td>
<td>Passes even if a source intended the reverse order.</td>
</tr>
<tr>
<td><code>["108.2", 16.1]</code></td>
<td>Fails because longitude is a string.</td>
</tr>
</tbody></table>
<h2>Review points that pass but look wrong</h2>
<p>Both values in <code>[48.9, 2.3]</code> fit either axis, so a range check cannot settle the intended order. For a feed that declares a limited service region, flag points well outside that region for review. Treat proximity as a signal. A ferry stop, an island, or a partner across a boundary can be legitimate.</p>
<p>If the upstream format names the fields, a mapping such as <code>{ longitude, latitude }</code> to <code>[longitude, latitude]</code> is deterministic. If the source is ambiguous, preserve the original record and review it with the source owner. Swapping plausible coordinates automatically can replace one wrong point with another.</p>
<h2>Keep fixtures for both kinds of error</h2>
<p>Test a reversed pair that fails latitude bounds and a reversed pair that passes. Add a string, a missing coordinate, and an optional altitude. Track structural rejections separately from records waiting for geographic review. This gives importers a clear distinction between data they can fix mechanically and places that need human context.</p>
]]></content:encoded></item><item><title><![CDATA[Caching Multilingual Place Pages Safely]]></title><description><![CDATA[Separate multilingual cache variants by URL or Accept-Language, and test the first request that warms a shared cache.]]></description><link>https://tripmap.hashnode.dev/caching-multilingual-place-pages-safely</link><guid isPermaLink="true">https://tripmap.hashnode.dev/caching-multilingual-place-pages-safely</guid><category><![CDATA[caching]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:10:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0fe0b238f42d1698e537a8/34fc8963-20a6-4d59-983e-486b3f6745a9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>An English-speaking traveler opens a place guide. A Vietnamese-speaking traveler follows the same shared link and sees English. Each visit works when tested on its own because the origin chooses the requested language. The problem appears when a shared cache serves the first response to both visitors. Multilingual travel pages provide a practical example. The routes and headers below are fictional. <a href="https://tripmap.vn/en/about">Tripmap in English</a></p>
<h2>Pick where language becomes part of the request</h2>
<p>Use a locale in the URL when readers should be able to share a specific translation. With <code>/en/places/example</code> and <code>/vi/places/example</code>, the two paths identify distinct resources at the cache boundary. A language switch can take the reader directly to the other path. If a locale-specific route serves a fixed language, the origin can return <code>Content-Language</code> to describe the response language.</p>
<p>A site can also serve multiple languages from <code>/places/example</code>. If that origin chooses the language from <code>Accept-Language</code>, send <code>Vary: Accept-Language</code> on every version, including the default response. A cache uses <code>Vary</code> to determine which request headers participate in selecting a stored variant. <code>Content-Language</code> describes the response. <code>Vary</code> tells the cache how to distinguish requests. <a href="https://www.rfc-editor.org/rfc/rfc9111.html#section-4.1">RFC 9111, section 4.1</a></p>
<pre><code class="language-http">HTTP/1.1 200 OK
Content-Language: vi
Vary: Accept-Language
Cache-Control: public, max-age=300
</code></pre>
<p>That example assumes a public page whose only language input is <code>Accept-Language</code>. A route that redirects to a locale-specific URL based on the same header must also account for the header if the redirect is cacheable. Verify the behavior of the shared cache you deploy, since its configuration determines whether and how it respects variants.</p>
<h2>Keep personal choices out of shared responses</h2>
<p>If the HTML includes saved places, account details, or content personalized by a preference cookie, give that response its own caching policy. Use a shared cache for content that can be served identically to all readers of a variant. For per-user content, <code>Cache-Control: private</code> protects it from storage by shared caches. Choose a stricter policy if the response should also stay out of browser caches. <a href="https://www.rfc-editor.org/rfc/rfc9111.html#section-5.2.2">RFC 9111 cache directives</a></p>
<h2>Test the requests that warm the cache</h2>
<ol>
<li>Start with a cold cache. Request Vietnamese, then English at the same negotiated route. Assert the language of both response bodies.</li>
<li>Clear the cache and reverse the order. A response can look correct until the default variant happens to be the first one stored.</li>
<li>Repeat with the language header omitted. Assert the documented default and verify that it does not affect the next explicit language request.</li>
<li>Make a signed-in request and confirm that any personalized fragment stays outside the shared cache.</li>
</ol>
<p>Run those checks through the same cache layer your readers reach. Checking only the origin can prove that translation selection works while missing the behavior visitors actually see.</p>
]]></content:encoded></item><item><title><![CDATA[Stable Pagination for Travel Search Results]]></title><description><![CDATA[Build stable search pagination with a score-and-ID cursor, then test tied results, changing rankings, and filter changes.]]></description><link>https://tripmap.hashnode.dev/stable-pagination-for-travel-search-results</link><guid isPermaLink="true">https://tripmap.hashnode.dev/stable-pagination-for-travel-search-results</guid><category><![CDATA[PostgreSQL]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:09:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0fe0b238f42d1698e537a8/8a435cc2-6222-4eb5-b018-87ea0b6bf749.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A traveler browsing places to visit in Đà Nẵng reaches the end of the first page and selects <strong>Show more</strong>. Two places appear again, and one never shows up. The problem can come from how the system defines a page boundary. Travel discovery gives us a concrete setting for the example. The records and queries below are fictional. <a href="https://tripmap.vn/en/attractions">Tripmap attractions</a></p>
<h2>Put tied results in a deterministic order</h2>
<p>A sort by <code>score DESC</code> can leave several places tied at the boundary. Add a unique, stable ID as a second sort key. With both fields descending, a fixed set of search results always yields the same order. Both fields in this example are required. The PostgreSQL documentation explains why <code>LIMIT</code> needs a predictable order. <a href="https://www.postgresql.org/docs/current/queries-limit.html">PostgreSQL documentation on LIMIT and OFFSET</a></p>
<table>
<thead>
<tr>
<th>Place ID</th>
<th>Score</th>
<th>Expected page</th>
</tr>
</thead>
<tbody><tr>
<td>104</td>
<td>90</td>
<td>1</td>
</tr>
<tr>
<td>103</td>
<td>90</td>
<td>1</td>
</tr>
<tr>
<td>102</td>
<td>90</td>
<td>2</td>
</tr>
<tr>
<td>101</td>
<td>80</td>
<td>2</td>
</tr>
</tbody></table>
<h2>Carry the whole boundary in the cursor</h2>
<p>Suppose the page size is two. The first query sorts by both fields and returns IDs 104 and 103. The next cursor records <code>(90, 103)</code> from the last row. A cursor holding only <code>90</code> would skip ID 102 if the next query searched for scores strictly below 90.</p>
<pre><code class="language-sql">SELECT place_id, score
FROM search_results
WHERE search_id = :search_id
  AND (score, place_id) &lt; (:cursor_score, :cursor_place_id)
ORDER BY score DESC, place_id DESC
LIMIT :page_size;
</code></pre>
<p>The named placeholders stand for values bound by the caller. For the first page, omit the cursor predicate. The tuple comparison fits this particular sort because both keys are descending. If you later change the direction of one field, change the pagination predicate alongside the sort. <a href="https://www.postgresql.org/docs/current/functions-comparisons.html#ROW-WISE-COMPARISON">PostgreSQL documentation on row comparisons</a></p>
<h2>Decide what happens when rankings change</h2>
<p>Keyset pagination handles ties and avoids page numbers shifting under inserts, but a place whose score changes can still cross the cursor. In this example, <code>search_id</code> identifies a fixed ranking revision. Keep the filters and sort order tied to that revision. When the revision expires or the filters change, have the client start from the first page and make that reset clear to the traveler.</p>
<p>Applications that rank live can accept a different trade-off. Document that successive pages may reflect updates, and test how the app handles a place that moves above or below the last boundary. A client can suppress duplicate IDs in its display, while the server still owns the rules for what constitutes a result page.</p>
<h2>Add a regression test at the page boundary</h2>
<p>Build a fixture where three places share a score and two fit on the first page. Assert that the combined result is <code>104, 103, 102, 101</code>, with no missing or repeated IDs. Add a second search revision and make sure its rows stay out of both pages. Those two checks catch the common mistakes of using an incomplete cursor and applying it to the wrong search.</p>
]]></content:encoded></item><item><title><![CDATA[Modeling Travel Dates Without Time Zone Bugs]]></title><description><![CDATA[Avoid off-by-one-day bugs in travel apps. Learn when to store a calendar date, a local schedule, or an exact instant, with a JavaScript example.]]></description><link>https://tripmap.hashnode.dev/modeling-travel-dates-without-time-zone-bugs</link><guid isPermaLink="true">https://tripmap.hashnode.dev/modeling-travel-dates-without-time-zone-bugs</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[timezone]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 10:06:14 GMT</pubDate><content:encoded><![CDATA[<p>A hotel check-in date of January 3 in Đà Nẵng should still say January 3 when the traveler opens their itinerary from Los Angeles. An arrival at 12:30 a.m. in Đà Nẵng is different: the same instant falls on January 2 in Los Angeles. Both values can appear on the same itinerary, and each needs its own representation.</p>
<p>The examples below use fictional records and standard JavaScript. A day-by-day planner provides a familiar place to think through the distinction. <a href="https://tripmap.vn/en/my-trips">Tripmap itinerary planner</a></p>
<h2>Give each value a type that matches its meaning</h2>
<table>
<thead>
<tr>
<th>Travel detail</th>
<th>Representation</th>
<th>Example</th>
</tr>
</thead>
<tbody><tr>
<td>Hotel check-in day</td>
<td>Calendar date</td>
<td><code>2027-01-03</code></td>
</tr>
<tr>
<td>Museum visit scheduled for 9 a.m. in Đà Nẵng</td>
<td>Local date and time plus a named time zone</td>
<td><code>2027-01-03T09:00</code>, <code>Asia/Ho_Chi_Minh</code></td>
</tr>
<tr>
<td>Confirmed arrival at a specific moment</td>
<td>Instant, with a display zone when needed</td>
<td><code>2027-01-02T17:30:00Z</code></td>
</tr>
</tbody></table>
<p>Keep a calendar date as a validated date-only value. Preserve the name of the time zone for a schedule defined by the local clock. A named zone lets your application resolve the applicable offset on the scheduled day, including in places that change clocks during the year. Use an instant when the job is to identify a precise moment, such as sending a reminder before an arrival.</p>
<h2>See how the wrong conversion changes the day</h2>
<p>JavaScript parses a date-only string such as <code>2027-01-03</code> as midnight UTC when you pass it to <code>Date</code>. Formatting that instant in Los Angeles shows January 2. The date picker saved January 3, but the conversion quietly changed a calendar date into a moment on the global timeline. <a href="https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.parse">ECMAScript specification for Date.parse</a></p>
<p>For an actual instant, pass the desired time zone explicitly when formatting. This small helper returns the calendar day for a validated ISO timestamp with an offset. It pulls out the date parts by name so the output stays in <code>YYYY-MM-DD</code> order. <a href="https://tc39.es/ecma402/#sec-intl.datetimeformat.prototype.formattoparts">ECMAScript Internationalization API</a></p>
<pre><code class="language-js">function dateInZone(instant, timeZone) {
  const formatter = new Intl.DateTimeFormat("en-GB", {
    timeZone,
    calendar: "iso8601",
    numberingSystem: "latn",
    year: "numeric",
    month: "2-digit",
    day: "2-digit",
  });

  const parts = Object.fromEntries(
    formatter.formatToParts(new Date(instant))
      .filter(({ type }) =&gt; type !== "literal")
      .map(({ type, value }) =&gt; [type, value])
  );

  return `${parts.year}-${parts.month}-${parts.day}`;
}

const arrival = "2027-01-02T17:30:00Z";
dateInZone(arrival, "Asia/Ho_Chi_Minh");    // "2027-01-03"
dateInZone(arrival, "America/Los_Angeles"); // "2027-01-02"
</code></pre>
<p>For an itinerary grouped by destination day, use the destination zone to place timed events on the calendar. A notification or confirmation can also show the viewer’s time as a separate, labeled value. A date-only booking belongs under the day the traveler actually selected.</p>
<h2>Test the boundaries that travelers cross</h2>
<ul>
<li><strong>Calendar date round-trip.</strong> Save January 3, reopen the trip from another time zone, and check that the hotel remains under January 3.</li>
<li><strong>Arrival after local midnight.</strong> Use the example above and check both the destination-day grouping and the viewer’s local display.</li>
<li><strong>Clock change in a destination zone.</strong> Cover a local time that occurs twice and one that is skipped. Define how the application asks for clarification or chooses an occurrence, then test that behavior.</li>
</ul>
<p>At each boundary, ask what the traveler meant when the value was entered. A calendar day should survive a change in viewer time zone, and a timed event should keep the correct instant.</p>
]]></content:encoded></item><item><title><![CDATA[Designing multilingual destination search for Vietnam]]></title><description><![CDATA[A practical guide to Vietnamese place names, accent folding, geographic intent, and evaluating multilingual destination search.]]></description><link>https://tripmap.hashnode.dev/designing-multilingual-destination-search-for-vietnam</link><guid isPermaLink="true">https://tripmap.hashnode.dev/designing-multilingual-destination-search-for-vietnam</guid><category><![CDATA[search]]></category><category><![CDATA[Geospatial]]></category><category><![CDATA[internationalization]]></category><dc:creator><![CDATA[Tripmap]]></dc:creator><pubDate>Wed, 02 Dec 2026 09:48:58 GMT</pubDate><content:encoded><![CDATA[<p>A traveler types <strong>Ha Long</strong>. Another types <strong>Hạ Long</strong>. A third asks in English for <strong>things to do near Ha Long Bay</strong>. All three queries point toward the same part of Vietnam, but the last one asks for a list of nearby places. A search system needs to decide both which place the traveler means and what to return about it.</p>
<p>At <a href="https://tripmap.vn/about">Tripmap</a>, maps, destination guides, and itinerary planning are part of the same travel experience. This article uses examples from Vietnam to outline a design for the search layer that connects them.</p>
<h2>Give each place a stable identity</h2>
<p>Store an internal ID, a Vietnamese display name, a place type, and a relationship to its destination. Keep alternate names and spellings alongside the record, with language information where available. Coordinates can support distance queries for individual venues. A region or body of water may need a boundary when a single point would give misleading results.</p>
<p>This model lets <strong>Hà Nội</strong> and <strong>Hanoi</strong> resolve to the same city while keeping <strong>Hạ Long Bay</strong> and <strong>Hạ Long City</strong> as separate records. Their relationship can inform ranking, but each record needs its own label and result type. That distinction matters when a traveler asks about the bay and expects attractions or tours associated with it.</p>
<h2>Use accent folding to find candidates</h2>
<p>Visually identical Vietnamese text can have different Unicode representations. Apply canonical normalization consistently to names, aliases, and queries so those representations compare the same way. <a href="https://unicode.org/reports/tr15/">Unicode Standard Annex #15</a> defines the normalization forms and how they handle canonical equivalence.</p>
<p>Keep a separate accent-insensitive search field so <strong>Da Nang</strong> can find <strong>Đà Nẵng</strong>. Include an explicit mapping for <strong>đ → d</strong> in the folded field. Removing combining marks alone leaves <strong>đ</strong> intact. Preserve the original spelling for display, and give exact name and curated alias matches greater weight than folded matches. Use the folded field to recover candidates when travelers omit accents or type on a keyboard without Vietnamese input.</p>
<h2>Rank for the task the traveler is trying to complete</h2>
<p>Start with exact name and alias matches. Then use the requested place type and geographic context to decide how to order candidates. When the query names a destination as an anchor, resolve the destination before retrieving nearby places. If the text and context still leave several plausible matches, show enough detail for the traveler to choose.</p>
<table>
<thead>
<tr>
<th>Query</th>
<th>What the result should do</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Da Nang</strong></td>
<td>Return the city and display <strong>Đà Nẵng</strong> with its Vietnamese spelling.</td>
</tr>
<tr>
<td><strong>Ha Long Bay</strong></td>
<td>Return the bay as the primary match and label the city separately if it appears.</td>
</tr>
<tr>
<td><strong>Things to do near Ha Long Bay</strong></td>
<td>Resolve the bay first, then return relevant places or activities in the surrounding area.</td>
</tr>
<tr>
<td><strong>Hotels near Ben Thanh Market</strong></td>
<td>Resolve <strong>Bến Thành Market</strong> as the landmark, then return accommodation ordered by useful proximity.</td>
</tr>
</tbody></table>
<p>A trip planner and a conversational travel app can use the same place IDs and geographic relationships. Surface the place type and parent destination with each result so either interface can explain which place it selected. For queries with unresolved ambiguity, a short follow-up question can be more useful than an arbitrary first result.</p>
<h2>Test retrieval and ranking separately</h2>
<p>Build a small set of labeled queries covering accented and unaccented names, English aliases, ambiguities between places, and requests such as <strong>hotels near</strong> or <strong>things to do in</strong>. Record the expected place ID and, where it matters, the expected result type. Keep pairs such as <strong>Đà Nẵng</strong> and <strong>Da Nang</strong> together so you can see whether a change improves one spelling at the expense of another.</p>
<p>Measure candidate recall at a fixed cutoff first. If the expected place never reaches the candidate set, adjust alias coverage, normalization, or retrieval. If the correct place is present but ranked too low, inspect intent and geography signals. Review the results by query type as well as overall so exact-name lookups do not hide regressions in nearby searches.</p>
<p>The design principle is simple. Resolve the place, interpret the task, and show enough geographic context for the traveler to make the next decision.</p>
<p><a href="https://tripmap.hashnode.dev/about">About Tripmap Engineering</a> · <a href="https://tripmap.vn/attractions">Explore destinations on Tripmap</a></p>
]]></content:encoded></item></channel></rss>