0
0

fix bug in regexp, prefix and fuzzy searchers

these searchers incorrectly called Next() on their underlying
searcher, instead of Advance().  this can cause values to be
returned with an ID less than the one that was Advanced() to,
which violates the contract, and causes other incorrect behavior.

fixes #342
This commit is contained in:
Marty Schoch 2016-06-21 09:00:05 -04:00
parent 9f31ea6805
commit 54b06ce0f6
3 changed files with 3 additions and 3 deletions

View File

@ -113,7 +113,7 @@ func (s *FuzzySearcher) Next() (*search.DocumentMatch, error) {
}
func (s *FuzzySearcher) Advance(ID string) (*search.DocumentMatch, error) {
return s.searcher.Next()
return s.searcher.Advance(ID)
}
func (s *FuzzySearcher) Close() error {

View File

@ -112,7 +112,7 @@ func (s *RegexpSearcher) Next() (*search.DocumentMatch, error) {
}
func (s *RegexpSearcher) Advance(ID string) (*search.DocumentMatch, error) {
return s.searcher.Next()
return s.searcher.Advance(ID)
}
func (s *RegexpSearcher) Close() error {

View File

@ -76,7 +76,7 @@ func (s *TermPrefixSearcher) Next() (*search.DocumentMatch, error) {
}
func (s *TermPrefixSearcher) Advance(ID string) (*search.DocumentMatch, error) {
return s.searcher.Next()
return s.searcher.Advance(ID)
}
func (s *TermPrefixSearcher) Close() error {