Opened 19 months ago

Last modified 17 months ago

#1488 assigned defect

CPAN-Explorer Search - always stays empty

Reported by: bowtie on behalf of user_7338 Owned by: azawawi
Priority: minor Milestone:
Component: CPAN Module Installer Version: 0.97
Keywords: Cc: itcharlie

Change History (11)

comment:1 Changed 19 months ago by bowtie

add another debug trace to Padre::Task::CPAN
then run
perl dev -t Padre::Task::CPAN

# 1360946806.67717 Padre::Task::CPAN::BEGIN '::DEBUG enabled'
# 1360946806.68411 (Thread 2) Padre::Task::CPAN::BEGIN '::DEBUG enabled'
# 1360946806.77951 (Thread 2) Padre::Task::CPAN::metacpan_autocomplete '
Content => {"fields":["documentation","release","author","distribution"],
"query":{"filtered":{"filter":{"and":[{"not":{"filter":{"or":[{"term":{"file.distribution":"kurila"}},
{"term":{"file.distribution":"perl_debug"}},
{"term":{"file.distribution":"perl-5.005_02+apache1.3.3+modperl"}},
{"term":{"file.distribution":"pod2texi"}},
{"term":{"file.distribution":"perlbench"}},
{"term":{"file.distribution":"spodcxx"}}]}}},
{"exists":{"field":"documentation"}},
{"term":{"file.indexed":true}},
{"term":{"file.status":"latest"}},
{"not":{"filter":{"term":{"file.authorized":false}}}}]},
"query":{"custom_score":{"script":"_score - doc[\'documentation\'].stringValue.length()/100",
"query":{"bool":{"should":[{"field":{"documentation.analyzed":"m*"}},
{"field":{"documentation.camelcase":"m*"}}]}}}}}},
"size":20}'
# 1360946813.22736 (Thread 3) Padre::Task::CPAN::metacpan_autocomplete 'Got \'403 Forbidden\' from metacpan.org'
Last edited 19 months ago by bowtie (previous) (diff)

comment:2 Changed 19 months ago by bowtie

  • Version changed from 0.94 to 0.97

comment:3 Changed 19 months ago by bowtie

  • Owner changed from DWIM-Perl to azawawi
  • Status changed from new to assigned

comment:4 Changed 19 months ago by bowtie

This looks like a change to the metacpan API
or
the The ElasticSearch query in Perl

sorry azawawi it's all your's, as I don't stretch at present :)

comment:5 Changed 19 months ago by bowtie

  • Summary changed from CPAN-Explorer Search *always* stays empts to CPAN-Explorer Search *always* stays empty

comment:6 Changed 19 months ago by bowtie

  • Summary changed from CPAN-Explorer Search *always* stays empty to CPAN-Explorer Search - always stays empty

comment:7 Changed 17 months ago by itcharlie

Just wanted to note that this code change below is just enough to make the CPAN EXPLORER work again.

Index: Padre/Task/CPAN.pm
===================================================================
--- Padre/Task/CPAN.pm	(revision 19729)
+++ Padre/Task/CPAN.pm	(working copy)
@@ -108,10 +108,11 @@
 		query => {
 			filtered => {
 				query => {
-					custom_score => {
-						query  => { bool => { should => $should } },
-						script => "_score - doc['documentation'].stringValue.length()/100"
-					},
+                    bool => { should => $should } 
+				#	custom_score => {
+				#		query  => { bool => { should => $should } },
+				#		script => "_score - doc['documentation'].stringValue.length()/100"
+				#	},
 				},
 				filter => {
 					and => [

Something is wrong with the custom_score query. metacpan is rejecting the request whenever the custom_score query is passed. I think it may also have something to do with the scripting language settings ( http://www.elasticsearch.org/guide/reference/modules/scripting/ ).As noted in the link the default language for scripting in elasticsearch is mvel. This change can be a workaround until someone figures out how make the custom_score query work.

comment:8 Changed 17 months ago by bowtie

Checkin created revision r19732

Version 1, edited 17 months ago by bowtie (previous) (next) (diff)

comment:9 Changed 17 months ago by bowtie

  • Cc itcharlie added

comment:10 Changed 17 months ago by bowtie

itcharlie well done

now we don't have a blank space any more

good luck with the next step :)

comment:11 Changed 17 months ago by bowtie

2013-05-01T17:08

<bowtie> itcharlie, try finding this https://metacpan.org/module/Tiny::Tiny or am I asking to much and out of scope :)
<itcharlie> bowtie:  via padre cpan explorer?
<bowtie> itcharlie, yes, sorry
<itcharlie> Yes it works
<itcharlie> but the top result is not Try::Tiny
<itcharlie> which is what probably the contest_score portion of the query was doing.
<bowtie> O, thats why I could not see it :)
<itcharlie> :( 
<bowtie> it do not understand elastic search, so I am not able to help you out here
<itcharlie> the limit of the search is set to 20 results
<itcharlie> and if I understand correctly the contest_score will sort the results based on Module character length
<itcharlie> so I guess my fix will not work so great when you have more than 20 results
<itcharlie> :(
<itcharlie> sorry about that I really could test much of it.
<bowtie> but now you have a test case :)
<itcharlie> you should post that in the ticket so I won't forget. maybe there is another way to sort the results
Note: See TracTickets for help on using tickets.