Help service¶
Purpose¶
The help domain (backend/internal/services/help/) suggests help articles for what a member is typing in Help search, the Contact us form or a problem report. It is keyword search over the help index and calls no model. It answers with article ids only, and the app shows its own localized titles and snippets.
How it chooses¶
The query is lowercased, stripped of accents and reduced to word stems, so Passwords and pàsswörds meet password. Each query word of three letters or more is matched as a word start against every article's fields, and an article scores for each field that holds it.
| Field | Score |
|---|---|
| Title | 6 |
Keywords from manifest.json |
5 |
| Summary | 3 |
| Body terms | 2 |
Body terms are the most used words of an article's body that its title, summary and keywords do not already hold, minus words common to many articles. The top three articles by score are returned, ties keep the catalog order, and a query that matches nothing suggests nothing. A query under three characters also suggests nothing.
Surface¶
| Method | Path | Description |
|---|---|---|
| GET | /help/suggestions?q=&surface= |
{ ids, source } where source is always rules. surface is search, contact or problem. Public (the contact form is), limited to 60 a minute per IP |
frontend/scripts/gen/gen-help-index.mjs writes articles.json next to the service from frontend/content/help/manifest.json and the article files, and a test fails when the article list drifts from the manifest. The app debounces typing, asks once per distinct query and shows the result as Suggested articles.