Skip to content

[2.8] [MOD-13432] Fix FULLTEXT field metric count (#8037)#8085

Merged
lerman25 merged 1 commit into2.8from
backport-8037-to-2.8
Jan 19, 2026
Merged

[2.8] [MOD-13432] Fix FULLTEXT field metric count (#8037)#8085
lerman25 merged 1 commit into2.8from
backport-8037-to-2.8

Conversation

@lerman25
Copy link
Collaborator

@lerman25 lerman25 commented Jan 19, 2026

backport #8037 to 2.8


Note

Aligns global indexing metrics with actual operations and adds accurate TEXT term counting.

  • Change FieldsGlobalStats_UpdateFieldDocsIndexed to accept FieldType and update all callers
  • In indexer.c, compute TEXT metric as delta of spec->stats.numTerms and record via FieldsGlobalStats_UpdateFieldDocsIndexed(INDEXFLD_T_FULLTEXT, ...)
  • Remove redundant document-level metric update in document.c; include info/global_stats.h where needed
  • Update INFO MODULES labeling to "indexing operations" per field type
  • Expand tests: field-type metrics (excluding TEXT docs), new TEXT terms metric behavior, multi-value JSON paths counted once per doc, and JSON NULL fields ignored

Written by Cursor Bugbot for commit 193fd56. This will update automatically on new commits. Configure here.

@lerman25 lerman25 force-pushed the backport-8037-to-2.8 branch from b928bd0 to 312c7ef Compare January 19, 2026 16:22
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

IndexEncoder encoder = InvertedIndex_GetEncoder(aCtx->specFlags);
const int isBlocked = AddDocumentCtx_IsBlockable(aCtx);

// Save the number of terms before indexing the current document for metrics
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

…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)
@lerman25 lerman25 force-pushed the backport-8037-to-2.8 branch from 312c7ef to 193fd56 Compare January 19, 2026 16:30
@lerman25 lerman25 enabled auto-merge January 19, 2026 16:46
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (41b4cb7) to head (193fd56).
⚠️ Report is 1 commits behind head on 2.8.

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     
Flag Coverage Δ
flow 82.07% <100.00%> (-0.27%) ⬇️
unit 42.09% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lerman25 lerman25 added this pull request to the merge queue Jan 19, 2026
Merged via the queue into 2.8 with commit b23bd5d Jan 19, 2026
11 checks passed
@lerman25 lerman25 deleted the backport-8037-to-2.8 branch January 19, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants