NAME

Astro::ADS::Result - A class for the results of a Search

VERSION

version 1.90

SYNOPSIS

my $search = Astro::ADS::Search->new(...);

my $result = $search->query();
my @papers = $result->get_papers();

my $next_q = $result->next();
$result    = $ads->query( $next_q );

DESCRIPTION

The Result class holds the response from an ADS search query. It will create attributes for all the fields specified in the fl parameter of the search OR it will hold the error returned by the UserAgent. If an error was returned, any calls to attribute methods will raise a polite warning that no fields will be available for that object.

By default, a successful search returns up to 10 rows of results. If more exist, the user iterates through them using the "next" method to generate a search query updated to start where the previous search left off.

Methods

get_papers

This method gets a list of Astro::ADS::Papers from the last query executed.

next

Creates a new search query term hashref, suitable for fetching the next N papers from the ADS. If not given as an argument, the default is 10 rows. It returns undef if you have already reached the end of the available results.

This takes the values from the response header and updates the start position, collects the original query q and other params and returns the hashref, ready for the next <$search-query>>.

If given an argument, it takes that as the number of rows to fetch.

See Also

*Astro::ADS
*Astro::ADS::Search
*ADS API
*Available fields for Results

AUTHOR

Boyd Duffee <duffee@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2025 by Boyd Duffee.

This is free software, licensed under:

The MIT (X11) License