The phrase that vanished from the catalog

The system kept a catalog of items used in price analysis. People typed the description of what they wanted to compare before looking at the results. A search for “serviços de vigilância” (“surveillance services”) returned nothing. “Vigilância” (“surveillance”) alone found the entry. It looked as though the catalog had lost a record. It had not. Search was reading the phrase differently from the person who typed it.

The index stored words of at least three characters, so “de” (“of”) was left out. The query still required every typed term to match, including the one the index could never provide. The empty result looked like a statement about the catalog. It was really two incompatible rules meeting each other.

The shortest fix would be to ignore two-character terms. Then along comes “A4”: also two characters, yet possibly the most important part of a paper search. Length could not tell us which term could be removed without changing the question.

When help changes the request

Another option surfaced in review: when a term has no match, continue with the rest. The query “caneta esferografica azull” showed the cost of that kindness. The misspelled color was dropped, and black and red pens came back. The result list was full, but it answered a different question.

“De” can be recognized as a connector. “Azull” cannot become permission to ignore the color. That distinction matters because a plausible list can inspire more confidence than an empty screen, even when the list is wrong.

Review also tried reducing catalog words to stems. That looked useful for plurals until “JEANS” became “jeam” and a literal search for “jean” stopped finding it. Prefix search depends on the words the catalog actually stores. Expansion belonged on the query side, without rewriting the catalog.

The plural riding along

Plurals had a trick of their own. Prefixes only grow to the right: “serviços” cannot reach “serviço”. One guessed stem was not enough either. Reducing “celulares” could stop at “celulare”, still short of “celular”. The query needed a set of candidates.

In a multiword test, another term could find the entry and make the test pass. The plural merely rode along. Putting “celulares” alone in the search box showed that it had contributed nothing to the match. That test changed the interpretation of the failure, not just the number of cases covered.

There was a quieter surprise in the ordering. Ranking looked for the typed term's position in the description; a result found only through expansion got position -1. The score could treat that -1 as better than a literal match at the start of the text. Expansion fixed which items appeared, but ranking still had to distinguish what the person wrote from what search inferred.

The whole question

The same catalog was queried by a search box, an import flow, and a relevance check. Each path interpreted terms in its own way. Review brought the rules into one shared place: known connectors stayed out, while short but meaningful terms such as “A4” remained searchable.

In the catalog tested, the full phrase found results again, isolated plurals stopped disappearing, and a misspelled color no longer became permission to return every color. The same cases ran through all three paths. Deliberately replacing candidate-set expansion with a single stem made the tests fail. That is stronger evidence than seeing them pass with the correct implementation alone, though it does not prove relevance for every future query.

It began with “de”, but that word was not the interesting part. The deeper issue was search's contract: which terms it may forgive, which must constrain the result, and how much weight an inferred match deserves. A nonempty list, by itself, answers none of those questions.