Skip to content

search: hyphenated titles and stopwords no longer empty BOOLEAN results - #526

Closed
t0ma5 wants to merge 1 commit into
mindstellar:developfrom
t0ma5:fix/search-hyphenated-fulltext
Closed

search: hyphenated titles and stopwords no longer empty BOOLEAN results#526
t0ma5 wants to merge 1 commit into
mindstellar:developfrom
t0ma5:fix/search-hyphenated-fulltext

Conversation

@t0ma5

@t0ma5 t0ma5 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • BOOLEAN search required every token. Deleting hyphens glued co-working into coworking, which FULLTEXT never indexed (it stores co + working), so pasting a hyphenated title returned no rows.
  • +and* / +in* failed the same way: InnoDB's default stopword list does not store those words, but BOOLEAN truncation still required them.
  • Hyphens and other punctuation are now split like the index, and unindexed tokens (too short or stopwords) are skipped. Quoted phrases drop those tokens too.

Test plan

  • php tests/models/search.php — 58 passed, including hyphenated title paste (Co-working space in Aville) and token co-working
  • Existing pins still hold: multi-word AND, prefix recall, -term exclusion, quoted phrase, below-min-length LIKE fallback
  • Paste a live listing title that contains a hyphen and and/in into public search; that listing is in the result set

Made with Cursor

…search

MySQL FULLTEXT indexes co-working as co plus working. Stripping the hyphen
required +coworking*, which matched nothing. InnoDB stopwords (+and*, +in*)
failed the same way. Split punctuation and skip tokens the index does not store.

Co-authored-by: Cursor <cursoragent@cursor.com>
@t0ma5
t0ma5 requested a review from navjottomer as a code owner August 29, 2026 12:11
@navjottomer

Copy link
Copy Markdown
Member

Can't ship this. ftIsStopword() hardcodes an English list, so on a German or Dutch install in, was, am get dropped from both BOOLEAN and LIKE — real search words, silently lost.

The hyphen half of the diagnosis is correct and worth fixing. The stopword half needs to be a filter, or read from the server's actual stopword table, not baked into core.

Open an issue first next time so we can agree the approach before you write it.

@navjottomer navjottomer closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants