eclipse-archived / ceylon-herd

The Ceylon repository web application
Apache License 2.0
21 stars 11 forks source link

Add API to find module by package name #102

Closed FroMage closed 10 years ago

FroMage commented 11 years ago

Depends on #9 I guess, to store the package names.

thradec commented 10 years ago

Do you want to add new api or extend RepoApi.searchModules with new parameter packageQuery?

FroMage commented 10 years ago

I think a new API endpoint

thradec commented 10 years ago

Done.

FroMage commented 10 years ago

Excellent!

This looks good, but I think it's a bit different from the original issue, because you implemented search by member, not just by package.

Also you implemented an inexact search.

I think we need another API to search just by package (not looking at member part), with a boolean option to search for exact match or partial match.

thradec commented 10 years ago

no problem

FroMage commented 10 years ago

Thanks!

quintesse commented 10 years ago

@thradec I was just looking at this because it seems this was never actually "connected" on the client side. Now trying to figure out how to do that I'm seeing that the searchModulesByMember() doesn't have an exactMatch parameter like searchModulesByPackage() does. Could you still add that one? Please? :)

quintesse commented 10 years ago

Hmm, there's even more. I'm seeing that the original module query isn't part of the API either. In the local implementation the package or member names are additional filters. If you just want to search for package name only we just pass "" to the module part of the query. Would it be possible to make it like that?

quintesse commented 10 years ago

So the thing is that the ModuleQuery object we use locally for our searches has the following fields:

    protected String name;
    protected Type type;
//    protected Retrieval retrieval;
    private Long start;
    private Long count;
    private long[] pagingInfo;
    private Integer binaryMajor;
    private Integer binaryMinor;
    private String memberName;
    private boolean memberSearchPackageOnly;
    private boolean memberSearchExact;

And all or any of those can be set. So what we really need is an API that can do that for the Herd.

PS: I commented out the "retrieval" field because it's new and it's implementation for the Herd is a separate issue (see ceylon/ceylon-herd#181).

thradec commented 10 years ago

@quintesse in 3e192b0 I added new API, temporary on path /api/1/search-modules2, let me know if it works as you requested. I removed former two /search-by-package and /search-by-member, which weren't used, but I'm not sure if I can remove also origin /search-modules, or leave it for backward compatibility?

quintesse commented 10 years ago

Thanks @thradec , I'll take a look at this as soon as I can.