sbp-flarum-search/src
Bart van Bragt d8eebb183a fix: prevent ES CPU saturation from has_child scoring all posts
Without minimum_should_match=1 on the inner post bool query, Elasticsearch
defaults MSM to 0 whenever a filter clause is present. This caused has_child
to score every non-hidden post on every search request, saturating CPU on
shared ES nodes with large corpora (3.7M+ posts).

- Add BoolQuery subclass with create() override and minimumShouldMatch()
  (spatie/elasticsearch-query-builder 1.x uses `new self()` in create(),
  so subclassing requires overriding it)
- Set minimumShouldMatch(1) on the inner post query after adding the
  is_hidden filter, so only genuinely matching posts are scored
- Remove the operator('or') clause from buildShouldClauses() — with
  Turkish min_ngram=2, 'or' generates 2-gram tokens that match nearly
  every post, causing near-total index scans
- Add ES client timeouts (connect: 2s, query: 10s) to prevent Apache
  mod_php worker saturation when ES is slow or unreachable
2026-04-14 16:07:50 +02:00
..
Api fix: prevent ES CPU saturation from has_child scoring all posts 2026-04-14 16:07:50 +02:00
Commands perf: eager-load relationships in UpdateSearchJob and cache permissions in DiscussionSeeder 2026-04-13 22:18:14 +02:00
Elasticsearch fix: prevent ES CPU saturation from has_child scoring all posts 2026-04-14 16:07:50 +02:00
Exceptions Apply fixes from StyleCI 2022-11-18 09:33:13 +00:00
Jobs fix: use Eloquent Collection in job — loadMissing does not exist on Support\Collection 2026-04-14 09:59:02 +02:00
Save feat: restructure index as parent-child documents with blue-green rebuilds 2026-04-09 23:30:57 +02:00
Searchers Apply fixes from StyleCI 2022-11-24 09:38:21 +00:00
Seeders fix: use Support\Collection for cachedGlobalPermission — pluck() returns plain Collection, not Eloquent 2026-04-14 11:27:02 +02:00
Provider.php fix: prevent ES CPU saturation from has_child scoring all posts 2026-04-14 16:07:50 +02:00