ropensci / oai

OAI-PMH R client
https://docs.ropensci.org/oai
Other
14 stars 4 forks source link

Limiting results #20

Open sckott opened 9 years ago

sckott commented 9 years ago

Noticed something while making fix in #18 - that we probably need to give user power to determine how much data they get back.

Our while loop will just keep going, getting more data if a resumptionToken is available.

We may not be able to expose a parameter that does this exactly, like limit = 10, and you get 10 results, but at least it could be something like

mbojan commented 9 years ago

Good idea. Definitely worth using when testing other functions... This could be:

mbojan commented 9 years ago

Alternatively:

sckott commented 9 years ago

Right, the confusing part about using integers though is that the user may be thinking if they set limit = 10, they'll get 10 records/identifiers/etc., but in reality, 10 http requests are made (if that many required), with probably 50 results X 10 requests = 500 results. I guess we can just make clear in docs.

Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.

mbojan commented 9 years ago

I think it may be clarified in the docs. We can also call the argument max_requests.

Alternatively, we could have user's input integers for how many records they want, then keep track of how many we've downloaded, etc. However, this gets complicated, maybe something to do later on.

Actually why would anybody be determined to fetch only some small number of records? Limiting number of requests makes sense for testing purposes.