Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchWithPaging doesn't return all results if size limit or time limit exeeded #411

Closed
tomqwpl opened this issue Jan 19, 2023 · 2 comments · Fixed by #417
Closed

SearchWithPaging doesn't return all results if size limit or time limit exeeded #411

tomqwpl opened this issue Jan 19, 2023 · 2 comments · Fixed by #417

Comments

@tomqwpl
Copy link

tomqwpl commented Jan 19, 2023

The Search method will return partial results if the size limit or time limit parameters are used and the limit is exceeded.

In the case of SearchWithPaging, the results are only appended if there is no error:

		result, err := l.Search(searchRequest)
		if err != nil {
			return searchResult, err
		}
		searchResult.Entries = append(searchResult.Entries, result.Entries...)

If you therefore use SearchWithPaging with a limit of, say, 5, and there are more results, you're not going to get any results.

I think the appends need to happen regardless of the error (assuming searchResult is non-nil)

@ksankeerth
Copy link

Hi @cpuschma,
Can I take this issue? Will you be able to review PR if i send? Thanks

@cpuschma
Copy link
Member

Sure, I would be very happy about a PR, @ksankeerth ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants