metacpan / MetaCPAN-Client

Home of the official MetaCPAN Perl API client.
21 stars 23 forks source link

"autocomplete" search not possible with this module #56

Closed akarelas closed 7 years ago

akarelas commented 7 years ago

Please make it possible to do "autocomplete" calls to the API

mickeyn commented 7 years ago

Please explain what you are trying to achieve (I'm not sure what I understand of this request will be in line with what the client is designed for). The client (through ES) already supports wildcards in terms (e.g. {name => "x*"}), which may cover this request.

akarelas commented 7 years ago

I want to do case-insensitive search on module name. So I would take the first result of autocomplete, and check if its name matches what I'm searching for (modulo case). Maybe it would be more correct to do a seach like this: $mcpan->all('modules', {...match => { name => 'mojolicious' } }), but I'm not sure then that the best match (plain Mojolicious) would come first in the results.

mickeyn commented 7 years ago

was that problem solved for you on IRC? I don't see this entering the client for now.

akarelas commented 7 years ago

No, we didn't discuss this problem on IRC. All I wanted to do is a case-insensitive search but I failed. I'll ask around.

mickeyn commented 7 years ago

well, these are 2 separate things. the 'autocomplete' is not something I see being added to the client, not soon that is. for case-insensitive, we have a 'lower-case' analyzer on the data in ES, so you should be able to craft an ES query to give you that.