Commit 8fffb71
Set num_returned on $match response for analytics item_count (#856)
* OpenConceptLab/ocl_online#73 | Set num_returned on \$match response
Surfaces the total number of matched items on the
MetadataToConceptsListView (\$match) response so the analytics
middleware can record it as APITransaction.item_count. Before this
fix, \$match transactions always recorded item_count=0 because the
POST handler returned Response(results) with no headers, and
analytics reads item_count from response.headers.num_returned.
num_returned is set to the sum of len(r['results']) across all input
rows — the total matches produced by the request, which is the
denominator the v2 data extraction plan (item 11) wants for
mapper_items_matched_30d / "rows matched per request" metrics.
Scope is \$match only. \$match-scispacy-loinc lives in ocl-scispacy-loinc
and needs a separate fix if we want item counts there too. Rerank view
has different semantics and is out of scope.
Refs #1 (data-extraction-v2 Bundle 2 loose ends).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Trim $match item_count comment
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9575b3a commit 8fffb71
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
991 | 999 | | |
992 | 1000 | | |
993 | 1001 | | |
| |||
0 commit comments