Skip to content

Show wiki matches in the board search - #56

Merged
bonelifer merged 6 commits into
mainfrom
feature/wiki-board-search
Oct 13, 2026
Merged

bonelifer merged 6 commits into
mainfrom
feature/wiki-board-search

Conversation

@bonelifer

Copy link
Copy Markdown
Contributor

Step 2 of the wiki search: matching wiki articles now appear next to the results of phpBB's own search. The wiki's own search page came in with #55.

  • The block. A keyword search in phpBB's search, or from the header search box, shows a Wiki (N) block above the forum results. It lists the best matches with title, description, a marked snippet and date, and ends with a "View all N wiki articles" link to the wiki's search page. The forum results are not changed. It shows on the first page of results only, only for members who may read the wiki, and not for searches by author, within one topic, or the pre-made ones such as active topics.
  • The option. The advanced search has an "Also search the Wiki" box, ticked by default. An unticked box stays unticked through the pages of results. It uses the core search events and two template events, so no core file changes and no event request was needed.
  • ACP. Extensions > Wiki > Search has two new settings: show wiki matches in the board search (on or off), and the number of articles in the block (1 to 50, default 5). The results per page of the wiki's own search page is unchanged. All three backends are now listed on that page; the ones the database cannot run are shown greyed out and cannot be chosen.
  • Migration. One new migration adds the two settings.
  • Shared service. The wiki's search page and the block use one search-results service, so the page's own code got shorter.
  • Fix in the ported backend. On MySQL, the native backend reported a total of 1 for titles-only and text-only searches whatever matched, because the Knowledge Base's copy of the count query always counted one row. It now counts the way phpBB core does. The block also shows only when there are rows to show.
  • Docs. README updated. The finished search plan moves to docs/TODO/archive/archive1.md with a record of what was built and covered. The TODO files record the decisions made for move/rename, the starter-templates repository (name, packaging) and edit conflicts, and drop the questions the built features already settled.

Tests

  • Unit tests: 256 tests, 563 assertions, all pass. The code sniffer passes on the whole extension.
  • A new 27-check browser test covers the option on the advanced search, the block above the forum results with highlighting and a matching count, the header search box, an unticked box and its pages, no block for author, topic and pre-made searches or when the wiki has no match, titles-only and text-only counts, the block size setting, a member without wiki read permission, and both ACP switches. The wiki's own search test (22 or 23 checks) was re-run too. Both pass on phpBB 3.3.19 and phpBB 4.0.0-a3-dev, each on SQLite, MySQL and PostgreSQL with the native backend, and with MySQL fulltext on MySQL and PostgreSQL fulltext on PostgreSQL.
  • Not covered locally: the Windows and MSSQL jobs that run in CI, and styles other than prosilver.
  • The same MySQL count bug exists in the Knowledge Base's copy of the backend. That is for a separate change in that repository.

Investigated and written by Claude on behalf of William Jacoby (bonelifer).

bonelifer and others added 6 commits October 13, 2026 02:34
A "Wiki (N)" block above the forum results of a keyword search, and an
"Also search the Wiki" option in the advanced search, through the core
search events and two template events. Settings: on/off and the number of
articles in the block. The wiki's search page and the block share one
search-results service.

Fixes the MySQL native backend's total for titles-only and text-only
searches, which counted one row whatever matched. All three backends are
listed in the ACP, the unusable ones disabled. The finished search plan is
archived and the TODO decisions recorded.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bonelifer
bonelifer merged commit 208d0db into main Oct 13, 2026
58 checks passed
@bonelifer
bonelifer deleted the feature/wiki-board-search branch October 13, 2026 07:49
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.

1 participant