Merge pull request #464 from steveyen/check-FieldDictPrefix-err
check for error when prefix searcher starts a FieldDictPrefix reader
This commit is contained in:
commit
4e16818656
|
@ -30,6 +30,9 @@ type TermPrefixSearcher struct {
|
|||
func NewTermPrefixSearcher(indexReader index.IndexReader, prefix string, field string, boost float64, explain bool) (*TermPrefixSearcher, error) {
|
||||
// find the terms with this prefix
|
||||
fieldDict, err := indexReader.FieldDictPrefix(field, []byte(prefix))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// enumerate all the terms in the range
|
||||
qsearchers := make([]search.Searcher, 0, 25)
|
||||
|
|
Loading…
Reference in New Issue
Block a user