Commit 1d14673
authored
Fix OpenSearch bucket aggregations (#272)
* Fix OpenSearch bucket aggregations
In order to build filter lists, we collect the values assigned to each key
using an OpenSearch bucket aggregation. Unfortunately, by default, a bucket
aggregation returns only the first 10 buckets; in at least one specific case
where someone noticed (the releaseStream keyword) we've exceeded 10 values and
expected terms aren't being reported.
This uses the `field`'s `size` keyword to return up to 1000 buckets instead.
This is likely overkill for many cases, but should be "safe" for most cases.
I considered adding code into `search.py` to analyzed returned bucket
aggregations for a non-zero `sum_other_doc_count` (which means we could have
returned additional terms), and report any case where this happens for log
stream analysis. This doesn't solve any additional problems, however, adds
more code, and is a little tricky given the logic to merge aggregations
against two OpenSearch instances. If some reviewer wants to insist, or if I
start feeling too guilty before I get an approval, I'll go ahead and do it.
Closes #2711 parent 471fea8 commit 1d14673
File tree
5 files changed
+10
-7
lines changed- backend
- app/api/v1
- commons
- endpoints
- ocp
- quay
- tests/unit
5 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
384 | | - | |
| 385 | + | |
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
388 | | - | |
| 389 | + | |
389 | 390 | | |
390 | 391 | | |
391 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
160 | | - | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
427 | | - | |
428 | | - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
0 commit comments