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

Wrong Book for Module Name #12

Closed
borisdaeppen opened this issue May 3, 2012 · 7 comments
Closed

Wrong Book for Module Name #12

borisdaeppen opened this issue May 3, 2012 · 7 comments
Labels

Comments

@borisdaeppen
Copy link
Collaborator

If I enter

Log::Log4perl

and press EPUB, I get

Tie-Log4perl-0.1.epub
@borisdaeppen
Copy link
Collaborator Author

The problem occurs because autocomplete from metacpan-api is used to match user-input.

Autocomplete has strange behavior here:

http://api.metacpan.org//v0/search/autocomplete?&q=Log++Log4perl

     {
        "_score" : 1.169038,
        "fields" : {
           "documentation" : "Tie::Log4perl",
           "release" : "Tie-Log4perl-0.1",
           "author" : "FRODWITH",
           "distribution" : "Tie-Log4perl"
        },
        [...]
     },
     {
        "_score" : 1.169038,
        "fields" : {
           "documentation" : "Log::Log4perl",
           "release" : "Log-Log4perl-1.36",
           "author" : "MSCHILLI",
           "distribution" : "Log-Log4perl"
        },
        [...]
     },
     {
        "_score" : 1.1590381,
        "fields" : {
           "documentation" : "Test::Log4perl",
           "release" : "Test-Log4perl-0.1001",
           "author" : "FOTANGO",
           "distribution" : "Test-Log4perl"
        },
        [...]
     },

Both, Tie::Log4perl and Log::Log4perl have the same score which is 1.169038.
Even worse, Tie::Log4perl is placed on top. If I add the parameter &size=1 to the request (in the URL) I will only get Tie::Log4perl - but I was asking for a match witch Log::Log4perl.

This looks like a bug to me...

@borisdaeppen
Copy link
Collaborator Author

I opened an issue here: metacpan/metacpan-api#203

No idea if this is going to be fixed soon... or at all.

@dvergin
Copy link

dvergin commented Jun 11, 2012

Similarly a request for "Moo" returns the docs for "ppt".

I added a comment at metacpan/metacpan-api#203 describing this somewhat different example (i.e. in this case the lookup terms are entirely unrelated and there is some confusion about the "documentation" field shown for ppt at http://api.metacpan.org//v0/search/autocomplete?&q=Moo)

Question:
Is there a work-around to "trick" perlybook onto returning the desired item?

[Edit]
Curiouser and curiouser: If I uncheck "fetch complete release", I get a file called Module_Moo.mobi which contains the docs for Moo but which shows "Perl Module Documentation ppt-0.14" on its title page. The "Table of Contents" page and the actual contents are all of "Moo". Only the title page is mis-labeled. And it appears in my mobi library as "ppt-0.14".

@borisdaeppen
Copy link
Collaborator Author

It's quite some pain to work with CPAN, because everything can happen there :-)

As a first step I'll try to replace the autocomplete at serverside. It looked handy as I implemented it, but now it's the cause of a lot of errors.

If anybody can help: I need a function (maybe from MetaCPAN::API) which allows me to check if a given module-name is valid... meaning will return a result.

@reneeb
Copy link
Owner

reneeb commented Jul 2, 2012

For stuff like the perl_mlb issue (#14) we should maintain a "blacklist".

Part of the solution could be to grab two items in the resultlist and when a distribution is in that resultlist matches the search term exactly, we should provide the distribution documentation.

Can we start a FAQ in the wiki please? In that FAQ we can document such problems.

@borisdaeppen
Copy link
Collaborator Author

The issue with the wrong matching can be solved by using requests like

http://api.metacpan.org/v0/module/EBook::MOBI

for modules and

http://api.metacpan.org/v0/release/EBook-MOBI

for releases. By putting this into an eval{} we should be able to tell if the request will be a valid one... I'll implement that in the next few weeks or days.

@borisdaeppen
Copy link
Collaborator Author

closed in commit fc65f5b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants