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

updated text for modified authorlimit defaul #270

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,11 @@ For example:
curl -H "Authorization: Bearer <your API token>" -H "Content-Type: application/json" -X POST -d '{"format":"\\\\bibitem[%\\2m%(y)]\\{%za1%y} %\\8l %\\Y,%\\j,%\\V,%\\p"}' https://api.adsabs.harvard.edu/v1/export/convert


## Limiting number of authors and affilations from the UI
A new parameter, `authorlimit`, has been introduced to limit the number of authors and their affiliations returned in exported records. This addresses the growing issue of excessively large author lists, with some papers featuring thousands of authors.

A new optional parameter, `authorlimit`, has been introduced to limit the number of authors and their affiliations returned in exported records. This parameter addresses the growing issue of excessively large author lists, which are becoming increasingly common, with some papers featuring thousands of authors.

The `authorlimit` parameter specifies the maximum number of authors and affiliations to retrieve from Solr and format in the service.

This parameter will be utilized in the ADS UI. However, when using the API, it is optional. If omitted, the service will return all authors and affiliations.
At the request of stakeholders, the `authorlimit` parameter has been set to a default value of 200 in the service. While this default is hardcoded, it remains configurable through both the ADS UI and the API, ensuring flexibility in controlling the number of authors and affiliations displayed based on user needs.

If the authorlimit parameter is omitted when using the API, the default value of 200 will apply. However, as mentioned, users can override this limit by explicitly specifying their desired value in the API request.

{"bibcode": ["1980ApJS...44..137K", "1980ApJS...44..489B"], "authorlimit": 500}

Expand Down
5 changes: 3 additions & 2 deletions export_with_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def get_records_export(data, endpoint):
identifiers = [doc['bibcode'] for doc in docs]
data = {"bibcode": identifiers}

# 2- include optional parameters (the same for all the formats), skip otherwise
data.update({"sort": "date desc, bibcode desc", "authorlimit": 500})
# 2 - include optional parameters (applicable to all formats); skip if not needed
# default values for these optional parameters are set below and can be modified as needed
data.update({"sort": "date desc, bibcode desc", "authorlimit": 200})

# 3- optional/required parameters for some of the export formats (ie, BibTex has an optional parameter keyformat)
# check the readme for the parameter(s) of your selected format
Expand Down
Loading