-
Notifications
You must be signed in to change notification settings - Fork 58
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
Number of rows returned from query limited to 2000? #39
Comments
Hi Jeff,
You're correct, the maximum number of rows is hardcoded at 2000 for this
type of search, even if you set the rows parameter to be higher. To return
the next set of results, use the start parameter (more info here:
https://github.com/adsabs/adsabs-dev-api/blob/master/search.md#start). For
example, to fetch the next set of results, set start += rows (in your
example, start += 2000).
Kelly
…On Mon, Jun 11, 2018 at 5:28 PM, Jeff Mangum ***@***.***> wrote:
Hello,
I am trying to extract citation statistics for various journals by running
two queries looped over a range in years:
for yr in yearlist:
articles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND
citation_count:[0 TO 999990]) +property:refereed -title:erratum",fl=fllist,
rows=3000))
zeroarticles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+"
AND citation_count:[0 TO 0]) +property:refereed -title:erratum",fl=fllist,
rows=3000))
...
I have found that
(1) If I do *not* set the rows parameter, I get a maximum of 50 results.
(2) If I set rows to 2000, I get at most 2000 results.
(3) If I set rows to a number larger than 2000, I get a maximum of 2000
results.
(4) It does not seem to matter if I set rows to a int or string in the
SearchQuery call
I need to be able to return more than 2000 results, or hack around this
limit by doing more smaller time range queries (which might cause me to
approach my query limit). Is there a reason for the rows=2000 upper limit?
If not, can it be increased? Thanks.
-- Jeff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHURkVgL1ivP6EmFD6orVeB9GEvHtq1Eks5t7uEHgaJpZM4UjbUs>
.
--
Dr. Kelly Lockhart
Back-End Developer, NASA Astrophysics Data System
Harvard-Smithsonian Center for Astrophysics
60 Garden Street, Cambridge, MA 02138
|
Thanks for the response. Tried setting start+=2000, only to get a syntax error:
SyntaxError: invalid syntax In fact, setting start to 2000 for the second pass through the search results in an index out of range error: ---> 37 articles1 = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND citation_count:[0 TO 999990]) +property:refereed -title:erratum",fl=fllist,start=2000,rows=2000)) /Users/jmangum/anaconda/lib/python2.7/site-packages/ads/search.pyc in next(self) /Users/jmangum/anaconda/lib/python2.7/site-packages/ads/search.pyc in next(self) IndexError: list index out of range -- Jeff |
Hi Jeff, it should be I think you should update your ads package; the code at https://github.com/andycasey/ads/blob/master/ads/search.py#L498 seems right to me if the problem persists, please create an issue with ads package; possibly the problem is here https://github.com/andycasey/ads/blob/master/ads/search.py#L547 (you did specify start parameter and the package may not be expecting it; but I did look only briefly) |
Thanks Roman. I believe I have the latest update (as it is dated March 27,2017): torgo:Stats jmangum$ python -c "import ads; print(ads.version)" I will create an issue with the ads package. Thanks again! -- Jeff |
Hello,
I am trying to extract citation statistics for various journals by running two queries looped over a range in years:
for yr in yearlist:
articles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND citation_count:[0 TO 999990]) +property:refereed -title:erratum",fl=fllist,rows=3000))
zeroarticles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND citation_count:[0 TO 0]) +property:refereed -title:erratum",fl=fllist,rows=3000))
...
I have found that
(1) If I do not set the rows parameter, I get a maximum of 50 results.
(2) If I set rows to 2000, I get at most 2000 results.
(3) If I set rows to a number larger than 2000, I get a maximum of 2000 results.
(4) It does not seem to matter if I set rows to a int or string in the SearchQuery call
I need to be able to return more than 2000 results, or hack around this limit by doing more smaller time range queries (which might cause me to approach my query limit). Is there a reason for the rows=2000 upper limit? If not, can it be increased? Thanks.
-- Jeff
The text was updated successfully, but these errors were encountered: