[8.6] [MOD-13432] Fix FULLTEXT field metric count#8086
[8.6] [MOD-13432] Fix FULLTEXT field metric count#8086redisearch-backport-pull-request[bot] merged 1 commit into8.6from
Conversation
* Fix metric full text metric counting * initialize fieldspec * Add missing include * remove redundant lines * test null fields * Don't count null text fields * reset counter * typo fix * remove redudant wrapper * Count terms indexed * remove extra line * test text indexing * fix test (cherry picked from commit 4e09df1)
| } | ||
|
|
||
| // Update the number of terms added for metrics | ||
| FieldsGlobalStats_UpdateFieldDocsIndexed(INDEXFLD_T_FULLTEXT, spec->stats.numTerms - prevNumTerms); |
There was a problem hiding this comment.
Disk-based indexes never update FULLTEXT field metric
Medium Severity
For disk-based indexes (spec->diskSpec is set), the FULLTEXT field metric is never updated. The metric calculation at line 133 uses spec->stats.numTerms - prevNumTerms, but IndexSpec_AddTerm (which increments numTerms) is only called in the non-disk branch (lines 110-112). In the disk branch (lines 105-108), numTerms is never updated, so the delta is always 0. The old code in fulltextPreprocessor called the stats update with 1 for all specs, so this is a regression for disk-based indexes.
Additional Locations (1)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.6 #8086 +/- ##
==========================================
- Coverage 84.01% 84.01% -0.01%
==========================================
Files 365 365
Lines 55097 55096 -1
Branches 14296 14296
==========================================
- Hits 46291 46289 -2
- Misses 8645 8646 +1
Partials 161 161
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Backport of #8037 to
8.6.Note
Refines global indexing metrics and aligns API/INFO/tests.
FieldsGlobalStats_UpdateFieldDocsIndexedto takeFieldTypeand update all call sitesFULLTEXT, increment metric by new unique terms per document (indexer.cusesspec->stats.numTermsdelta); remove redundant doc-level incrementinfo/global_stats.hinclude)Written by Cursor Bugbot for commit 88d2723. This will update automatically on new commits. Configure here.