Closed altuncu closed 1 month ago
That's intentional, because I assumed every user wants to the maximum possible count
per result.
The Scopus docs (https://dev.elsevier.com/documentation/ScopusSearchAPI.wadl) state the count
parameter is about the "maximum number of results", but that's misleading. It pertains only to the results page. Since the Scopus Search API uses pagination (i.e., results are returned via pages that link to each other so that the total results set is unlimited), the count
variable here governs only the number of results per page, which just boosts up the number of pages.
If pybliometrics was to set count
to 1, as in your case, you would not get 1 page with 200 results but 200 pages with 1 result. This would consume 200 calls of your key.
Thanks for the answer. Does this mean that there is no way to limit the total number of results in the API, regardless of the pagination? In my case, I need to obtain the most relevant N articles given a search query. I can consider only the first N records from the search result, but it's not efficient for the queries returning a high number of records because of the downloading process. So, is it possible to limit the number of records returned in the first place to avoid unnecessary downloads?
Currently this is not possible with ScopusSearch()
but I will think about how it can be realized. For your use case you would need three kwds
(as per https://dev.elsevier.com/documentation/ScopusSearchAPI.wadl): "sort", "start" and "count".
None of this is difficult but requires careful testing. Sorry for the late answer, I forgot about this issue.
The first step will be to replace the count
parameter in the search super class (https://github.com/pybliometrics-dev/pybliometrics/blob/f5a6f7fb3788f52422d253c87a345a11ce85ced5/pybliometrics/scopus/superclasses/search.py#L14). That's a parameter for the pagination, but when users provide count
in an effort to limit the number of results, our parameter assumes priority.
The other parameters should work already. Please test with "sort", you may also use the other search classes.
Parameter "count" can now be used as per the Scopus documentation. However (!), it doesn't work as expected for the Scopus Search API. The number of results equals the count parameter times the number of result pages. Unlike the other search API, Scopus Search API uses pagination to cycle through the results set. When you provide "count", the API returns this number for each page rather than in total. Very weird, but I think we have to consider the possibility that Scopus lets their API degrade.
I can also confirm the other keyword parameters work as expected.
Hi,
I want to limit the number of maximum search results with the
count
parameter. But, it does not seem working. An example is provided below:The output: