Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit cb2d904

Browse files
author
Stephen Gutekanst
committed
search: skip over missing / invalid indexes
Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
1 parent 6616fb5 commit cb2d904

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doctree/indexer/search.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/gob"
77
"fmt"
88
"io/ioutil"
9+
"log"
910
"os"
1011
"path/filepath"
1112
"sort"
@@ -145,7 +146,8 @@ func Search(ctx context.Context, indexDataDir, query string) ([]Result, error) {
145146
for _, sinterFile := range indexes {
146147
sinterFilter, err := sinter.FilterReadFile(sinterFile)
147148
if err != nil {
148-
return nil, errors.Wrap(err, "FilterReadFile: "+sinterFile)
149+
log.Println("error searching", sinterFile, "FilterReadFile:", err)
150+
continue
149151
}
150152

151153
queryKey := strings.FieldsFunc(query, func(r rune) bool { return r == '.' || r == '/' || r == ' ' })
@@ -160,7 +162,8 @@ func Search(ctx context.Context, indexDataDir, query string) ([]Result, error) {
160162

161163
results, err := sinterFilter.QueryLogicalOr(queryKeyHashes)
162164
if err != nil {
163-
return nil, errors.Wrap(err, "QueryLogicalOr")
165+
log.Println("error searching", sinterFile, "QueryLogicalOr:", err)
166+
continue
164167
}
165168
defer results.Deinit()
166169

0 commit comments

Comments
 (0)