Commit Graph

49 Commits

Author SHA1 Message Date
mueh 22e2796a65 admin js hatte noch alte blomstra-search drin 2026-04-28 10:27:28 +02:00
mueh 52168bb5c3 js wieder gefixt aus anderem commit 2026-04-28 10:01:50 +02:00
MauBiBot f72acc60ef Rename blomstra/search fork to sbp/flarum-search (Phase 1: namespaces, routes, JS initializers) 2026-04-22 22:23:47 +02:00
MauBiBot 4538fe2ba8 Add prefix search for content and enable autocomplete 2026-04-22 20:43:33 +02:00
MauBiBot 3e2f3f9585 always use ES search on initial search page load 2026-04-22 19:46:09 +02:00
MauBiBot bf90e3279e remove frontend default sort from discussion search state 2026-04-22 19:31:30 +02:00
MauBiBot 7f282cdb84 merge local search fixes after pull 2026-04-22 18:56:43 +02:00
mueh 0fa8fb92eb ai forgot to commit 2026-04-22 15:47:54 +02:00
Bart van Bragt d27d71ff72 style: apply prettier formatting to admin/index.ts 2026-04-16 11:57:59 +02:00
Bart van Bragt f7d9935fb9 feat: suppress ES instant results when search-post-bodies is enabled
When searching inside comments is ON, the autocomplete dropdown now returns
nothing from ES (only usernames show). This avoids showing title-only matches
that are inconsistent with the full comment-body search results.

Also passes filter[autocomplete]=1 to the API so the server uses the fast
title.autocomplete path instead of the full has_child query.
2026-04-16 11:57:34 +02:00
Bart van Bragt 33d4946947 feat: stem exclusion admin setting and analyzer language selector improvements
Add a stem-exclusion textarea to the admin settings page. Words entered here
(one per line) are passed as stem_exclusion to the language analyzer, preventing
them from being stemmed. Requires a full re-index to take effect.

The two language-dependent fields (stem exclusion, min search length) are
disabled when CJK is selected, since neither applies to bigram analysis.

Settings are reordered: search-scope switches now appear above the language
block so the language-dependent fields sit directly below the language selector.

Replace the lowercase ES identifier labels in the language dropdown with proper
display names (e.g. "Brazilian Portuguese", "CJK (Chinese, Japanese, Korean)",
"Sorani (Kurdish)"). Drift detection now tracks stem exclusion instead of the
removed min_gram index setting.
2026-04-16 11:52:34 +02:00
Bart van Bragt c55db0abd6 fix: show TerminalPost in search results when field sort is active or mostRelevantPost is unavailable
When params.q is set, Flarum core suppresses TerminalPost and only shows an
excerpt from mostRelevantPost. This leaves the info section empty when the post
is null (e.g. hidden/deleted first post in production) or when results are
ordered by a field sort where an excerpt is meaningless.

Extend DiscussionListItem.infoItems to:
- Replace excerpt with TerminalPost when a field sort (latest, oldest, top) is
  active — relevance excerpts are not meaningful when sorted by date/count.
- Fall back to TerminalPost when no excerpt was added (mostRelevantPost null).
2026-04-15 21:24:55 +02:00
Bart van Bragt c5643bed31 fix: default search sort to latest and keep dropdown label in sync
- Search with no explicit sort now defaults to latest (updated_at desc)
  on both backend and frontend, matching the forum UX expectation.
- "All discussions" link from the search box routes to /?q=...&sort=latest
  so the sort dropdown shows "Latest" immediately after submission.
- extendDiscussionState injects sort=-lastPostedAt into API params when
  no sort is present, keeping direct-URL navigation (?q=anan) consistent
  with the backend default.
- Backend guard changed from phpSortField===null to empty($sorts), which
  is the correct sentinel since $sorts is the authoritative ES sort list.
2026-04-15 17:21:10 +02:00
Bart van Bragt bf37e01eb0 fix: read forum attribute lazily inside extend callback 2026-04-14 09:33:17 +02:00
Bart van Bragt 4709b9d1db fix: is_hidden boolean coercion and forum settings access 2026-04-14 08:59:19 +02:00
Bart van Bragt f486292f15 feat: make ngram min_gram configurable via admin setting
Adds a 'Minimum search query length' setting (1–4, default 3). The admin
shows a warning when the analyzer or min-search-length have changed since
the last index build.
2026-04-10 13:19:22 +02:00
Bart van Bragt 4412583cd9 chore: fix prettier formatting and npm audit vulnerabilities
Reformat admin/index.ts to satisfy prettier checks. Update package-lock.json
via npm audit fix to resolve 17 vulnerabilities in transitive dev dependencies
(webpack, babel, lodash, ws, semver, etc.).
2026-04-10 11:47:38 +02:00
Bart van Bragt 81e7b6502d feat: Show admin dashboard notice when search index needs rebuilding
After a mapping change (e.g. the parent-child restructure), existing installs
need to rebuild their index. A DashboardWidget appears on the admin page
warning the admin and showing the command to run. Compatibility is tracked
via the blomstra-search.index-compatible setting.
2026-04-10 11:10:53 +02:00
Daniël Klabbers f6503f5e6a fix: #10, private forums have no discussions key, throws error 2023-01-30 23:17:01 +01:00
Daniël Klabbers 83afe95d61 chore: fix search and seeding 2022-11-24 10:37:57 +01:00
Daniël Klabbers 846cc348ff Merge branch 'dk/search-improvements' into main 2022-11-24 10:29:18 +01:00
Ian Morland f500d7f956 fix: revert back to not using the elastic endpoint for filtering, at least until we support tags in the search database 2022-11-21 12:37:52 +00:00
Ian Morland 23dd403417 fix: override endpoint not used correctly 2022-11-18 09:29:19 +00:00
Daniël Klabbers 4bc89949ec complete testing 2022-11-10 12:54:26 +01:00
Daniël Klabbers 29ba864849 settings configurations 2022-11-09 18:06:48 +01:00
Ian Morland 886e78d6fb Format js 2022-05-03 09:13:50 +01:00
Daniel Klabbers ca229c8af8 possibly reduce logging 2021-12-13 12:06:26 +01:00
Daniel Klabbers 868713da11 fix: search for byobu page
Fixes the index for byobu.
2021-11-16 20:22:22 +01:00
Daniel Klabbers 5600236bb8 exclude byobu from elastic for now 2021-11-11 13:12:36 +01:00
Daniel Klabbers cc9c57308e re enable search, cleanup 2021-11-11 13:12:17 +01:00
Daniel Klabbers 050482dd4a fix calling xhr still 2021-11-10 14:39:47 +01:00
Daniel Klabbers bad10ef03d only override the search on the frontend if its not already been handled by the backend to prevent duplicate queries 2021-11-10 13:36:34 +01:00
Daniel Klabbers a03de74f0b clean up js 2021-11-10 12:39:41 +01:00
David Wheatley c96a0f54bf
fix: indexpage search not hitting custom endpoint 2021-10-31 22:47:46 +00:00
Daniël Klabbers 61e2f90835 wip 2021-10-31 02:53:16 +02:00
Daniël Klabbers 6c045ab595 wip 2021-10-30 13:01:51 +02:00
Daniel Klabbers 12bc9d74e0 wip 2021-10-29 10:42:57 +02:00
Daniël Klabbers 07a1e9dc44 wip 2021-10-27 08:02:07 +02:00
David Wheatley 70bffb7aa0
hotfix: don't use custom search endpoint when there is no search query 2021-10-22 18:57:43 +01:00
David Wheatley a5b62f56da
feat: restore post excerpt in search dropdown 2021-10-21 18:55:36 +01:00
David Wheatley 7401332092
fix: maintain consistency in API requests (`discussions`) 2021-10-21 17:59:04 +01:00
David Wheatley e3f74b5f07
feat: override discussion search page 2021-10-21 17:58:37 +01:00
Daniel Klabbers 4130e49bee wip 2021-10-15 13:51:36 +02:00
Daniel Klabbers 43e2e038e3 endpoint is now posts 2021-10-14 21:33:16 +02:00
Daniel Klabbers f69541d38a moved to elastic 2021-10-14 12:31:45 +02:00
David Wheatley f4dca3d185
feat: add discussion search source 2021-10-13 20:18:21 +01:00
David Wheatley d646c719f3
chore: migrate FE fully to TS 2021-10-13 20:16:14 +01:00
David Wheatley d6efed3e77
chore: format code 2021-10-13 19:31:05 +01:00
Daniel Klabbers 2bf4ec01d0 wip 2021-10-12 23:15:47 +02:00