Skip to content

Commit a460a21

Browse files
committed
skills: address review comments on validate-search-filters
- Rename 'aggregation count query' to 'count-only query' to accurately reflect the use of size:0 without an aggregation pipeline. - Add explicit note that track_total_hits is intentionally omitted; approximate counts are sufficient evidence for field presence. - Fix grep command to use -E flag for portable extended regex syntax. Assisted-by: github-copilot:claude-sonnet-4.6 Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
1 parent 326535d commit a460a21

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

  • .agents/skills/validate-search-filters

.agents/skills/validate-search-filters/SKILL.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and optionally apply fixes.
3131
accepts both `project_uid` and `committee_uid` can only send one at a time.
3232
- `handleSearchPastMeetingParticipants` and `handleSearchPastMeetingSummaries`
3333
are dedicated handlers — each owns its own filter logic independently.
34-
- **Prefer aggregation counts over random sampling.** A handful of random
34+
- **Prefer count-only queries over random sampling.** A handful of random
3535
documents proves nothing — you can get lucky and see the right fields while
3636
90% of the corpus has them missing. Always run `"size": 0` prefix count
3737
queries first. Only pull sample documents (`"size": 3`) as a secondary
@@ -73,7 +73,7 @@ first** to find every file that calls `QueryResources`. The table may be out of
7373
date if new tools have been added since it was last updated.
7474

7575
```bash
76-
grep -rn "QueryResources\|QueryResourcesPayload" internal/tools/ | grep -v "_test.go"
76+
grep -rEn "QueryResources|QueryResourcesPayload" internal/tools/ | grep -v "_test.go"
7777
```
7878

7979
For each file that appears, read the handler and record how each filter
@@ -150,10 +150,16 @@ treat those filters as "no contract definition" in the report.
150150

151151
## Step 4 — Count hits in the live index
152152

153-
For each filter parameter, run an **aggregation count query** (`"size": 0`)
154-
via the NATS box. This is the primary evidence step. Use the `$NATS_POD` and
153+
For each filter parameter, run a **count-only query** (`"size": 0`) via the
154+
NATS box. This is the primary evidence step. Use the `$NATS_POD` and
155155
`$OPENSEARCH_BASEURL` variables set in Step 1.
156156

157+
> **Note:** These queries omit `track_total_hits: true`, so `hits.total.value`
158+
> may be capped at 10,000 on very large indices. This is intentional — an
159+
> approximate count is sufficient to confirm a field is populated. If a count
160+
> comes back at exactly 10,000, treat it as "≥10,000 hits" rather than a
161+
> precise figure.
162+
157163
**Count documents where a specific tag key has non-empty values (last 45 days):**
158164

159165
```bash

0 commit comments

Comments
 (0)