Don't search the same term twice
We have searched for the first term in the phrase query already so we can skip it. Before doing so we have to add the location of the first term.
This commit is contained in:
parent
d87b4f88bf
commit
3dd363afaa
|
@ -110,8 +110,9 @@ func (s *PhraseSearcher) Next(ctx *search.SearchContext) (*search.DocumentMatch,
|
|||
OUTER:
|
||||
for _, location := range locations {
|
||||
crvtlm := make(search.TermLocationMap, 0)
|
||||
crvtlm.AddLocation(firstTerm, location)
|
||||
INNER:
|
||||
for i := 0; i < len(s.terms); i++ {
|
||||
for i := 1; i < len(s.terms); i++ {
|
||||
nextTerm := s.terms[i]
|
||||
if nextTerm == "" {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue