Parser gives confusing response for operator:shortword search
#1.933 aberto em 26 de fev. de 2026
Métricas do repositório
- Stars
- (4.680 estrelas)
- Métricas de merge de PR
- (Mesclagem média 7d 4h) (20 fundiu PRs em 30d)
Description
I searched for title:xz trying to find the story about the xz backdoor. The mariadb search engine doesn't index two-character words, which app/models/search_parser.rb refers to as shortwords (not stopword - similar context and term, so they're easy to confuse).
But this query is parsed incorrectly:
The :xz is confusing here. Only "xz" is a shortword, and the : should be associated with title. But it's not well-defined to search for a title with an empty string. I'm not sure off the top of my head what the correct parse of this should be, I just know the current one is misleading to the user.
This search should be added to spec/models/search_parser_spec.rb in the "bugs I've seen in prod" describe block.