ElsevierDev / elsapy

A Python module for use with Elsevier's APIs: Scopus, ScienceDirect, others.
http://api.elsevier.com
BSD 3-Clause "New" or "Revised" License
372 stars 146 forks source link

Setting num_res on ElsClient has no effect #32

Open rogerrohrbach opened 5 years ago

rogerrohrbach commented 5 years ago

It is possible to pass an argument when instantiating an ElsClient to set the the number of results to retrieve with each request. The num_res property is correctly set, but is unused; the first request issued does not include a count parameter, and subsequent requests are made using the next link in the response, which stipulates the default (count=25).

katrinleinweber commented 5 years ago

I think this issue results from https://github.com/ElsevierDev/elsapy/blob/a8a8b043816441e3ed0c834e792f7089231092da/elsapy/elsclient.py#L28

Maybe the 25 there can't be overwritten by setting num_res anywhere else?

Either way @ElsevierDev: Please add a little bit of control over how many results ElsClient downloads. In my use-case, 25 is too few to prototype a bibliometrics analysis pipeline, but get_all=True yields 5000 which is way too much initially. I would like to start with num_res=200 to 500 and finally run it (slowly, over a weekend or something) to retrieve 10, 20 or 50k results.

ciaranraymer commented 3 years ago

@rogerrohrbach, @katrinleinweber could you give an example of this argument and where you've passed it? I've been hammering away trying to expand the search results returned, but I'm locked in at 25.

ciaranraymer commented 3 years ago

Nevermind, found the solution. For anyone else struggling with this - within the exampleProg.py file you can change get_all to True. I.e.: doc_srch.execute(client, get_all = True)