(t *testing.T, labelSets ...labels.Labels)
| 4189 | } |
| 4190 | |
| 4191 | func newBlockBaseQuerierForSearch(t *testing.T, labelSets ...labels.Labels) *blockBaseQuerier { |
| 4192 | t.Helper() |
| 4193 | ix := newMockIndex() |
| 4194 | // Group series refs by label for writing postings. |
| 4195 | postings := make(map[labels.Label][]storage.SeriesRef) |
| 4196 | for i, ls := range labelSets { |
| 4197 | ref := storage.SeriesRef(i) |
| 4198 | require.NoError(t, ix.AddSeries(ref, ls)) |
| 4199 | ls.Range(func(lbl labels.Label) { |
| 4200 | postings[lbl] = append(postings[lbl], ref) |
| 4201 | }) |
| 4202 | } |
| 4203 | for lbl, refs := range postings { |
| 4204 | require.NoError(t, ix.WritePostings(lbl.Name, lbl.Value, index.NewListPostings(refs))) |
| 4205 | } |
| 4206 | return &blockBaseQuerier{index: ix, chunks: nil, tombstones: tombstones.NewMemTombstones()} |
| 4207 | } |
| 4208 | |
| 4209 | func collectSearchResultSet(t *testing.T, rs storage.SearchResultSet) []storage.SearchResult { |
| 4210 | t.Helper() |
no test coverage detected
searching dependent graphs…