-
Notifications
You must be signed in to change notification settings - Fork 12
Filter by author / dist name #1
Comments
Yes, definitely, there's a TODO file in the repo with that sort of thing on it ("complex search") :). Currently it takes the rather simple brute force regex approach so doing filtering (depending how it's done) could be a large change. One idea I had is to actually use metacpan API for some of it, to avoid reimplementing "searching CPAN", but I don't know how workable that would be in reality. I'm afraid it's a little hard to setup at the moment, I haven't had a chance to clean it up, but let me know if you have trouble and I'll see what I can do. |
Yeah, I really need this feature as well. I'd like to be able to search against just one dist for something simple, but I can't seem to get any sort of RE to work for that effect. For example:
These don't work. First one doesn't have single line support a la I think in terms of implementation, it can simply be done post-match, which would throw out the results if it doesn't match the author/dist. This could actually be done on the same singular field as well, similar to Google's extra variables.
Yes, this is far more than is on this request, but since we are venturing in the realm of expanding the simple "this whole blank line is a regular expression", I felt it important to document all possible features we would use for this new parser. Yes, this would destroy some backwards compatibility, but the result would be far more powerful than what we have right now. And by documenting what we could have in there, we would no longer need to break BC again when we want to expand. Implementing most of this would be somewhat easy, however. The things you could save for later would be: more than one fixed/re filter, ln: filter, negative filters, custom MetaCPAN attribute filters. |
So actually most of this is implemented already, just there's a leak in Redis connections which I've not yet tracked down so it's not live. See the dev copy for an example: I don't really see the point in making a distinction between RE and non-RE, as it accepts regexps anyway it's less confusing if everything is one. |
Sorry, I guess I was trying to make it more like Google, but still keep the power of the RE via the What's left from the list from above? I can put in the rest as a new issue. |
|
BTW, just to confirm, have delimiters been implemented? With m/s/i support? Also, shouldn't this issue be open until it's been commited into master? |
This seems to fail, I'm assuming because of the dashes: Even fails on escaping: http://cpangrep3.default.dgl.uk0.bigv.io/?q=dist%3Adh\-make\-perl+LICENSE |
On May 2, 2012 11:12 PM, "Brendan Byrd" <
Are you sure dh-make-perl is indexed on CPAN? MetaCPAN seems to call it
|
Yeah, you're right. But what about this? http://cpangrep3.default.dgl.uk0.bigv.io/?q=dist%3ADhMakePerl+{LICENSE}i I guess that answers my question about delimiters and m/s/i support, unless you have it in a different format. |
On 3 May 2012 13:04, Brendan Byrd <
The normal regexp syntax of (?i) or (?i:...) works, I don't see a reason |
Oh yeah, forgot about that silly syntax. Yeah, just needs some docs to remind us. I think that covers everything. So, where is the new code at within this repo? You said that you still had a leak to hunt down? |
The majority of the interesting code for this is: https://github.com/dgl/cpangrep/blob/master/lib/WWW/CPANGrep/Search.pm particularly _parse_search and filter_results. As for the leak I haven't yet tracked it down, I suspect a circular ref., maybe between some of the coderefs in that file, maybe elsewhere. |
Oh okay, so it's in master here, but this code isn't quite put on the production web site? |
Exactly. |
I think it'd be useful to be able to provide patterns which should be matched against only the author / dist name to filter results down - for instance, to look for your own name, but not in your own modules, for a random example usage.
If I get sufficient tuits I'll fork the repo, try to get a dev version of this up and running, and submit a pull request, but just thought I'd raise it as a "wishlist" issue item to share the idea at least.
The text was updated successfully, but these errors were encountered: