DEV Community

Lee X
Lee X

Posted on

Building a Location-Aware Discovery Engine: Why “Nearby” Isn't Just Distance

"Nearby" sounds like a simple feature.

Calculate the distance between the user and every location.

Sort by distance.

Done.

In practice, that's not enough.

A useful local discovery engine has to understand more than geography.

That's one of the problems we're tackling with LeeX.

The basic version

A traditional nearby query might look like:

User location

Calculate distance

Sort ascending

Return results

If Restaurant A is 500 meters away and Restaurant B is 2 kilometers away, Restaurant A wins.

But what if Restaurant A is permanently closed?

What if Restaurant B is much more relevant to the user's category?

What if Restaurant B is currently featured?

What if thousands of people have recently interacted with Restaurant B?

Distance alone doesn't capture usefulness.

Our discovery model

We're thinking about discovery as a combination of signals:

Discovery Score =
Distance
+
Relevance
+
Activity
+
Popularity
+
Featured status
+
Availability
+
User context

The exact weighting can evolve.

The important part is that proximity is one signal, not the entire algorithm.

Distance still matters

We don't want to ignore geography.

For local discovery, distance is extremely important.

A user looking for a restaurant probably cares whether it is:

500 m
1 km
2 km
5 km
10 km

That's why LeeX can expose radius-based discovery.

But distance should normally be combined with other information.

Category context

Suppose someone opens LeeX and selects:

Restaurants

The discovery engine should not treat every listing equally.

The system already knows the user's current intent.

That gives us a stronger query:

Nearby
+
Restaurant
+
Open
+
Relevant

rather than:

Nearby
+
Everything

Featured listings

LeeX also has a promotion layer.

Featured listings can receive additional visibility across relevant discovery surfaces.

But promotional ranking needs to be handled carefully.

A featured listing shouldn't necessarily make every other result useless.

Instead, we can think of featured placement as an additional ranking signal or dedicated placement.

For example:

Featured
────────────
Business A

Nearby Results
────────────
Business B
Business C
Business D

This separates promotion from organic discovery.

Activity changes discovery

Cities are dynamic.

A location that was quiet yesterday may become extremely active today.

That's why activity can become another signal.

For example:

Interactions
Check-ins
Views
Saves
Moments
Recent activity

The exact metrics can change as LeeX evolves.

The concept is what matters:

Discovery should understand what is happening, not only what exists.

Time matters too

Consider events.

An event happening tonight should be more relevant than an event that ended last week.

So event discovery introduces temporal relevance:

Upcoming
Live
Ended

A discovery engine therefore has at least two dimensions:

Where?
When?

And eventually:

Why is this relevant?

A simplified ranking model

A conceptual scoring system might look like:

score =
proximity_score

  • relevance_score
  • activity_score
  • popularity_score
  • featured_score

Each component can be normalized.

For example:

proximity_score = 1 / (1 + distance)

The actual production algorithm can become considerably more sophisticated.

The important architectural decision is keeping the ranking system modular.

Why modular ranking matters

Discovery algorithms change.

What works with 10,000 listings may not work with 10 million.

We don't want ranking logic scattered across dozens of endpoints.

Instead:

Candidate listings

Filtering

Feature calculation

Ranking

Result composition

UI

This makes experimentation easier.

The future

Eventually, LeeX can move beyond simple location-aware discovery toward contextual discovery.

Imagine:

«"Find interesting places near me tonight."»

That query contains:

Location
+
Time
+
Intent
+
Potentially category

That's much closer to how people actually explore cities.

The core principle

The goal isn't to build the world's biggest directory.

It's to make a city easier to explore.

And that means answering a much harder question than:

«"What is closest?"»

The better question is:

«"What is most useful to this person, in this place, at this moment?"»

That's the direction we're taking LeeX discovery.

Top comments (0)