Skip to content

Commit

Permalink
search/searcher: fix dropped test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs committed Oct 11, 2023
1 parent 840fde5 commit 06631b3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions search/searcher/search_boolean_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ func TestBooleanSearch(t *testing.T) {
t.Fatal(err)
}
conjunctionSearcher7, err := NewConjunctionSearcher(nil, twoDocIndexReader, []search.Searcher{martyTermSearcher7, booleanSearcher7}, explainTrue)
if err != nil {
t.Fatal(err)
}

// test 7
beerTermSearcher8, err := NewTermSearcher(nil, twoDocIndexReader, "beer", "desc", 1.0, explainTrue)
Expand Down
6 changes: 4 additions & 2 deletions search/searcher/search_conjunction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func testScorchCompositeSearchOptimizationsHelper(

next, err := cs.Next(ctx)
i := 0
for err == nil && next != nil {
for next != nil {
docID, err := indexReader.ExternalID(next.IndexInternalID)
if err != nil {
t.Fatal(err)
Expand All @@ -391,8 +391,10 @@ func testScorchCompositeSearchOptimizationsHelper(
t.Errorf("missing %s", string(docID))
}
}

next, err = cs.Next(ctx)
if err != nil {
t.Fatalf("error iterating searcher: %v", err)
}
i++
}

Expand Down
8 changes: 4 additions & 4 deletions search/searcher/search_term_range_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@ func TestTermRangeSearchTooManyTerms(t *testing.T) {
}
next, err := searcher.Next(ctx)
i := 0
for err == nil && next != nil {
for next != nil {
extId, err := scorchReader.ExternalID(next.IndexInternalID)
if err != nil {
t.Fatal(err)
}
got = append(got, extId)
ctx.DocumentMatchPool.Put(next)
next, err = searcher.Next(ctx)
if err != nil {
t.Fatalf("error iterating searcher: %v", err)
}
i++
}
if err != nil {
t.Fatalf("error iterating searcher: %v", err)
}
err = searcher.Close()
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 06631b3

Please sign in to comment.