Fix paging

This commit is contained in:
James Mills
2021-02-07 19:06:25 +10:00
parent aee086ea34
commit c31fc9569f
2 changed files with 1 additions and 373 deletions

View File

@@ -50,7 +50,7 @@ func (i *indexer) Search(q string, p int) (*bleve.SearchResult, error) {
searchRequest.Fields = []string{"URL", "Title", "Author", "Summary", "Length"}
searchRequest.Highlight = bleve.NewHighlight()
searchRequest.Size = i.conf.ResultsPerPage
searchRequest.From = searchRequest.Size * p
searchRequest.From = searchRequest.Size * (p - 1)
searchResults, err := i.idx.Search(searchRequest)
if err != nil {
log.WithError(err).Error("error searching index")

File diff suppressed because one or more lines are too long