[2.8] [MOD-13432] Fix FULLTEXT field metric count (#8037)#8085
Conversation
b928bd0 to
312c7ef
Compare
| IndexEncoder encoder = InvertedIndex_GetEncoder(aCtx->specFlags); | ||
| const int isBlocked = AddDocumentCtx_IsBlockable(aCtx); | ||
|
|
||
| // Save the number of terms before indexing the current document for metrics |
There was a problem hiding this comment.
FULLTEXT metric not updated in bulk indexing path
Medium Severity
The new FULLTEXT metric tracking was only added to writeCurEntries but not to writeMergedEntries. When multiple documents are queued for indexing (indexer->size > 1), writeMergedEntries is called instead, which also adds new terms via IndexSpec_AddTerm but doesn't update the textTotalDocsIndexed metric. This causes the FULLTEXT term count to be understated during bulk/async indexing scenarios.
Additional Locations (1)
…com/RediSearch/RediSearch/issues/8037)](https://github.com/RediSearch/RediSearch/issues/8037)) * 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)
312c7ef to
193fd56
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.8 #8085 +/- ##
==========================================
- Coverage 87.70% 87.65% -0.05%
==========================================
Files 203 203
Lines 35355 35354 -1
==========================================
- Hits 31007 30990 -17
- Misses 4348 4364 +16
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:
|
backport #8037 to 2.8
Note
Aligns global indexing metrics with actual operations and adds accurate TEXT term counting.
FieldsGlobalStats_UpdateFieldDocsIndexedto acceptFieldTypeand update all callersindexer.c, compute TEXT metric as delta ofspec->stats.numTermsand record viaFieldsGlobalStats_UpdateFieldDocsIndexed(INDEXFLD_T_FULLTEXT, ...)document.c; includeinfo/global_stats.hwhere neededWritten by Cursor Bugbot for commit 193fd56. This will update automatically on new commits. Configure here.