index out of range bugfix
This commit is contained in:
parent
3f79fc8e6c
commit
f4fcf0d9a8
1 changed files with 2 additions and 5 deletions
|
|
@ -225,8 +225,6 @@ func (e *Engine) GetAll(public bool) (t Titles, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t = make(Titles, len(res.Hits)-1)
|
|
||||||
i := 0
|
|
||||||
for _, v := range res.Hits {
|
for _, v := range res.Hits {
|
||||||
if v.ID == "Index" {
|
if v.ID == "Index" {
|
||||||
continue
|
continue
|
||||||
|
|
@ -241,8 +239,7 @@ func (e *Engine) GetAll(public bool) (t Titles, err error) {
|
||||||
}
|
}
|
||||||
f, ok := field.(*document.TextField)
|
f, ok := field.(*document.TextField)
|
||||||
if ok {
|
if ok {
|
||||||
t[i] = Title{string(f.Value()), v.ID}
|
t = append(t, Title{string(f.Value()), v.ID})
|
||||||
i++
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue