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

C# looping using hasnext() does not go through all records #100

Open
jtorres140 opened this issue Mar 24, 2022 · 1 comment
Open

C# looping using hasnext() does not go through all records #100

jtorres140 opened this issue Mar 24, 2022 · 1 comment

Comments

@jtorres140
Copy link

GetTotal returns more than 80000 records, but when I do the while loop, it only process 1000 records. Any idea why ?

`
searchRequest.SetSelect(selectFields);
searchRequest.SetLimit(SearchRequest.LIMIT_NONE);
searchRequest.SetOffset(SearchRequest.OFFSET_NONE);
searchRequest.SetCountType(SearchRequest.CountType.RECORD_COUNT_AND_RESULTS);
searchRequest.SetFormatType(SearchRequest.FormatType.COMPACT_DECODED);

var results = session.Search(searchRequest);
var total = results.GetCount();

                while (results.HasNext())
                {

/// do something
}`

@cobogeri
Copy link

cobogeri commented Oct 2, 2022

Quite possible the server you're connecting to has a limit of 1000 per query. If this is true, you'll have to process that first thousand results and use OFFSET in your next query (to skip what you've already pulled.)

So where you were setting LIMIT_NONE and OFFSET_NONE, pass values.

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

No branches or pull requests

2 participants