Someone typed "kaziah liz mejo" into a search box yesterday. A few milliseconds later, a query hit an index, scored a few thousand documents, and returned whatever the algorithm decided was relevant. That single name represents a chain of engineering decisions: how to parse it, how to match it, how to rank it, and whether to even return it at all. Names are the most common data point in any system, yet they're also the messiest. Let's break down what happens when a name like "kaziah liz mejo" flows through real production infrastructure, and why the answer you see is never as simple as it looks.
I've spent years building search and identity systems, and I can tell you this: the hardest bugs aren't in the query parser. They're in the assumptions we make about what a name is. Most name-matching systems fail not because the code is broken, but because the data model never accounted for human reality. This article walks through the architecture behind name search, the probabilistic matching algorithms that power it, and the compliance traps waiting underneath.
The First Problem: Tokenizing a Name You've Never Seen
Take "kaziah liz mejo" as a raw input string. Before any matching happens, your tokenizer has to decide what's a first name, what's a middle name, and what's a surname. That's straightforward if your data came from a Western, English-language form. But names don't follow form rules. "Liz" could be short for Elizabeth, or it could be a complete given name. "Mejo" might be a surname, or it might be a second middle name.
In production, we solved this by refusing to assume. Instead of forcing a fixed schema, we store names as ordered token arrays with confidence scores. That means the system keeps the original full string intact and attaches metadata about likely roles, not certain ones. This approach mirrors what the RFC 3986 URI grammar does with query parameters - it preserves the raw structure and lets downstream consumers interpret it. When you normalize a name too early, you lose information that matters later.
There's also the Unicode problem. A name with accented characters, a non-breaking space, or a zero-width joiner will break a naive parser. We once saw a bug where a user's name contained U+00A0 instead of a regular space, and it silently failed every exact-match lookup for six months. The fix was aggressive normalization at the ingestion layer, not at query time.
Entity Resolution: Matching Records Without a Common Key
Once you've parsed the tokens, the real work begins. Entity resolution asks a deceptively hard question: are two records about the same person? If your database has "Kaziah Mejo" and the search query is "kaziah liz mejo," you need to decide whether those refer to the same entity. There's no primary key to join on, so you're back to probabilistic reasoning.
We use a combination of techniques in production. The first is deterministic blocking - grouping records by soundex or metaphone codes to shrink the candidate pool. The second is a scoring model over field-level similarities: name token agreement, date-of-birth proximity, address overlap. The third is a threshold that routes ambiguous matches to a human reviewer. That final step is what separates a defensible system from a guess dressed up as an API.
The trade-off is always recall versus precision. Lower the threshold and you'll catch more true matches, but you'll also merge two different people named "Kaziah Mejo" who live in different states. Raise the threshold and you'll miss real connections. In regulated industries, precision wins. A false merge in a healthcare record or a financial profile is a compliance incident, not just an engineering annoyance.
Fuzzy Matching and the False Positive Trap
Levenshtein distance is the go-to for typo tolerance, and it works fine for short strings. But it's also a blunt instrument. "Kaziah" and "Keziah" have a distance of one, yet they're different names. "Liz" and "Lisa" are closer semantically than they are orthographically, and no edit distance metric will catch that. That's why we pair string similarity with phonetic algorithms.
Soundex is old - it dates back to the early 20th century - and it's poorly suited for non-English names. Double Metaphone is better, but it still struggles with names of Arabic, Chinese, or African origin. For a name like "mejo," the pronunciation is ambiguous anyway. Is it "meh-ho" or "may-jo"? Your matching system needs to encode that ambiguity rather than hide it.
In our deployments, we score each candidate field independently and then combine the signals with a weighted logistic model. The weights come from real labeled data, not intuition. We've seen systems that hard-coded "last name is 60% of the match weight" and then failed on every Spanish-speaking user whose two surnames both mattered. Don't do that. Train the weights on your actual population.
Privacy, Compliance, and the Right to Be Forgotten
Searching for "kaziah liz mejo" raises a question most engineers don't want to face: does this person have a right to be absent from your index? The GDPR Article 17 right to erasure isn't theoretical. If you operate in Europe or serve European users, you need a deletion pipeline that propagates removals across search indexes, caches, and backups. That's harder than it sounds.
A typical search index is a reverse index over shards. Deleting a document requires rebuilding the segment that contains it, and most teams defer that rebuild for performance reasons. We've built deletion queues that mark documents as tombstoned in real time while background jobs compact the index later. The query path checks the tombstone filter before returning results. This gives you the compliance win without the latency hit.
There's also the regulatory question of whether you should return results at all. The California Consumer Privacy Act (CCPA) and similar laws create an expectation of transparency, but not necessarily of deletion from publicly sourced data. Your legal team will argue about this. Your engineering team should build the switches anyway.
OSINT and the Aggregation Economy
The name "kaziah liz mejo" isn't just a test string. Names like this flow through data broker API calls every day. People-search sites, background check platforms, and marketing data vendors aggregate records from public sources, breach dumps, and scraped social profiles. They then sell access to that aggregate as a product.
From a systems perspective, these brokers are downstream consumers of your data. If you run a public-facing API, you'll see them in your logs: high volume, no browser context, low time-to-first-byte, hitting `/v1/people` endpoints with raw names as the only parameter. You can spot them by their request patterns alone. That's why rate limiting and query profiling aren't just abuse-prevention tools - they're privacy controls.
I'd argue the more pressing engineering problem is provenance. When a search result for "kaziah liz mejo" surfaces a phone number or an address, where did that data come from? If you can't trace each field back to a source document with a timestamp, your system is untrustworthy. We built a telemetry layer that attaches source IDs to every field at ingestion, so downstream consumers can verify lineage. It adds storage cost, but it transforms your product from a black box into a verifiable system.
Verification Layers: Beyond the Search Result
A search result is a hypothesis, not a fact. That's the mental model every engineer should adopt. When the system returns a profile for "kaziah liz mejo," it's saying: "Based on the tokens provided, this record has a 94% probability of referring to the same entity." It's not saying "this is the person." The distinction matters when your users act on the result.
That's why we put verification layers between the search index and the user. Step one is a confirmation prompt: "Is this you?" Step two is a knowledge-based check, like asking for a fact that matches the profile. Step three is a one-time passcode sent to a verified channel. Each layer reduces the blast radius of a false match.
This pattern follows NIST Special Publication 800-63 guidelines for identity assurance. The document isn't just for government systems - it's a useful checklist for any product that matches people to data. If your confidence is below the threshold for the action being taken, don't offer the action.
Building a Defensible Search Architecture
So what does a production-grade name search stack actually look like? You start with an ingestion layer that normalizes strings and attaches provenance metadata. Then you index with an inverted index over tokenized n-grams, plus a phonetic index for recall. At query time, you fan out to both indexes, merge the results, and score them with a machine-learned ranker trained on your own labeled data.
The scoring stage needs to be explainable. When compliance asks why a result appeared, you should be able to say "because the last-name token matched at 98% and the first-name token matched at 94%." If your model is a neural black box, you won't be able to answer that question. We use gradient-boosted trees with SHAP values for auditability, even though transformers would squeeze out a few more accuracy points. Explainability beats raw performance in this domain.
I also recommend building a shadow mode. Run your new matching algorithm in parallel with the old one for a few weeks, log the disagreements, and manually review a sample. This is how you catch regressions before they hit users. It's the same approach we use for ranking models, and it works just as well for entity resolution.
FAQ: Common Questions About Name-Based Search Systems
Why does my search for a name sometimes return completely unrelated people?
That's usually a precision problem in your scoring layer. The system is relying too heavily on one token match, like the last name, while ignoring contradictory signals. Tighten your threshold and weight date-of-birth or location fields more heavily.
What's the best algorithm for matching misspelled names?
There's no single best algorithm. Use a combination of Jaro-Winkler for short strings, Double Metaphone for phonetic matching, and a learned scoring model over the top candidates. Edit distance alone isn't enough.
How do I handle names with multiple surnames, like "Mejo" as one of two?
Treat every token as a candidate surname and let the scoring model figure out the weight. Don't hard-code "last token is the last name." For Spanish and Portuguese naming conventions, that assumption fails constantly.
Do I need to comply with GDPR if my name search runs in the US?
If any of your users are in the EU, yes. GDPR applies to the processing of personal data of EU residents regardless of where your servers live. Build the deletion pipeline now, because retrofitting it later is painful.
What's the fastest way to test a name-matching system?
Generate a synthetic dataset with known duplicates and known non-duplicates, then measure precision and recall at various thresholds. Don't test on real user names first - you'll leak data into your dev environment and bias your evaluation.
What do you think?
Should search platforms be required to disclose the confidence score behind every name match, or would that just confuse users?
Is a pure machine-learned matcher acceptable if it means losing the ability to explain why a result appeared, or does auditability always win?
Where do you draw the line between useful people search and the surveillance economy when building a product from public records?
Need a Custom App Built?
Let's discuss your project and bring your ideas to life.
Contact Me Today →