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

Api/changes #13

Merged
merged 13 commits into from Jul 3, 2014
Merged

Api/changes #13

merged 13 commits into from Jul 3, 2014

Conversation

Talina06
Copy link
Contributor

@oalders : I have made all the changes to the scripts in this pull requests. And tidied everything.

Please have a look at it.

index => 'v0',
type => 'author',
my $scroller = es()->scroll_helper(
search_type => "scan",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've switched all of the single quotes to double quotes here (and in other places). Let's only use double quotes where there's interpolation (a variable being inserted into the quotes). Could you change this in all of the appropriate places?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oalders Oh yes, I hadn't checked my changes properly. My bad.

@Talina06
Copy link
Contributor Author

@oalders Please let me know if further editing is required.
Thanks :)

p $search;
say '#' x 80;
while ( my $author = $search->next ) {
p $search;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried running this? This is the output I get:

~/Documents/github/metacpan-examples ∙ ./bin/carton scripts/endpoints/author/1a-search-authors-mcpan-api.pl
raw results
################################################################################
MetaCPAN::Client::ResultSet  {
    Parents       Moo::Object
    public methods (6) : facets, new, next, scroller, total, type
    private methods (2) : _assert_scroller, _get_facets
    internals: {
        scroller => Search::Elasticsearch::Scroll,
        type     => "author",
    }
}
MetaCPAN::Client::ResultSet  {
    Parents       Moo::Object
    public methods (6) : facets, new, next, scroller, total, type
    private methods (2) : _assert_scroller, _get_facets
    internals: {
        scroller => Search::Elasticsearch::Scroll,
        type     => "author",
    }
}
################################################################################
Total matches: 2

The original script provided the author fields. In this case you're printing a resultset object, which doesn't really tell us anything about the author. The point of the print is to show the user which available fields they would be getting etc, so I think we need to preserve that.

@oalders
Copy link
Member

oalders commented Jun 24, 2014

So close!

oalders added a commit that referenced this pull request Jul 3, 2014
@oalders oalders merged commit 32b2d2e into metacpan:master Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants