Commit Graph

19 Commits

Author SHA1 Message Date
Bart van Bragt e2e2d1428f feat: restructure index as parent-child documents with blue-green rebuilds
- Switch to ES parent/child join_field: discussion docs hold all metadata,
  post docs hold content only. Routing ensures parent and child land on the
  same shard. Removes the old flat-document approach where post data was
  duplicated onto every comment document.

- Add HasChildQuery with inner_hits so the best-matching post ID is
  surfaced as mostRelevantPost without a second DB query.

- Blue-green index rebuilds: --recreate writes into a timestamped pending
  index, --swap atomically promotes it via alias. Interrupted builds are
  resumable with --recreate --continue. --swap requires confirmation before
  proceeding.

- Index hidden posts; non-moderators are filtered at query time via
  is_hidden on the has_child clause. Core\Hidden and Core\Restored trigger
  re-indexing so moderators with post.hide can search hidden posts.
2026-04-09 23:30:57 +02:00
Bart van Bragt 80d66c98c4 feat: index and sync view_count for fof/discussion-views sort support
- Rename SavingJob to UpdateSearchJob
- Add ViewsSearchJob for lightweight partial view_count updates
- Add probabilistic sync throttle in DiscussionSeeder::viewingOn()
  to avoid an ES update on every page view
- Add view_count to mapping, DiscussionSeeder::toDocument(), and
  translateSort
- Log a warning and skip instead of 500ing on unknown sort fields
2026-04-09 12:05:28 +02:00
Bart van Bragt 5929a191f6 fix: --seed-missing stops early when a full range is already indexed
When all documents in a range were already in the index, the empty
collection caused continueAt to be set to null, aborting before
scanning lower ID ranges. Now advances past the range bottom instead.
2026-04-09 11:17:17 +02:00
Bart van Bragt 6699c8cb58 fix: ngram min_gram=1 indexes tokens that can never be matched
Flarum's search UI enforces a minimum query length of 3 characters
(MIN_SEARCH_LEN in Search.tsx), so 1- and 2-character ngram tokens
are indexed but can never be queried. Changed min_gram from 1 to 3
and updated max_ngram_diff accordingly.
2026-04-09 11:04:27 +02:00
Daniël Klabbers 508bb42ac9 chore: clean up buildcommand 2022-11-23 12:46:04 +01:00
StyleCI Bot db74da3e37
Apply fixes from StyleCI 2022-11-23 11:29:48 +00:00
Daniël Klabbers a02d35394b feat: store tags, rawId, support indexing missing objects 2022-11-23 12:09:10 +01:00
StyleCI Bot f8aa3dcf13
Apply fixes from StyleCI 2022-11-18 09:33:13 +00:00
Daniel Klabbers 803d1ecfc5 fix partial matching and weighting 2022-01-10 14:16:42 +01:00
Daniel Klabbers b6ac018a56 fix partial matching 2022-01-03 16:53:45 +01:00
Daniel Klabbers 68fce10d56 support patching the mapping without recreating 2021-11-16 20:33:17 +01:00
Daniël Klabbers 8b1a32af8d add comment count to mapping 2021-11-11 21:46:17 +01:00
Daniël Klabbers 3106667519 attempt to improve results loading with eloquent 2021-11-08 16:04:42 +01:00
Daniël Klabbers b87a4e2328 support continue flag 2021-11-06 21:32:36 +01:00
Daniel Klabbers bcdf625603 added --recreate and --only to command 2021-11-05 20:10:06 +01:00
Daniel Klabbers 614e630fde add throttling and sorting 2021-11-05 13:51:06 +01:00
Daniel Klabbers ff4e6be86a allow bigger chunk sizes 2021-11-04 12:28:19 +01:00
Daniel Klabbers 4c056a4db4 force queue 2021-11-04 10:47:24 +01:00
Daniel Klabbers 4e6f560376 reduce complexity of rebuild command 2021-11-02 14:47:24 +01:00