metacpan / metacpan-grep-front-end

Grep Front end code
GNU General Public License v3.0
13 stars 12 forks source link

Search does not work at all #43

Open pali opened 6 years ago

pali commented 6 years ago

https://grep.metacpan.org/search?q=db2ANSI

Result for query db2ANSI is:

found 3 distributions and 6 files matching your query !

with output:

 DBD-drizzle 1 match - lib/DBD/drizzle.pm

Which contradict information itself. How can be there just one matched file, if there there was found 3 distributions and 6 files?

Also I'm sure that there are lot of other matches in different packages with above query. Therefore search does not work at all.

And JSON API gives me same wrong result:

$ curl -s -X GET 'https://grep.metacpan.org/api/search?q=db2ANSI&qd=&qft=' | json_xs
{
   "time_elapsed" : 0.51662,
   "is_a_known_distro" : 0,
   "version" : "1.00-cache-1.03-grep-7fa205e-cpan-68326bef5dd",
   "results" : [
      {
         "files" : [
            "lib/DBD/drizzle.pm"
         ],
         "distro" : "DBD-drizzle",
         "prefix" : "distros/D/DBD-drizzle",
         "matches" : [
            {
               "file" : "lib/DBD/drizzle.pm",
               "blocks" : [
                  {
                     "matchlines" : [
                        189
                     ],
                     "start_at" : "184",
                     "code" : "\npackage DBD::drizzle::db; # ====== DATABASE ======\nuse strict;\nuse DBI qw(:sql_types);\n\n%DBD::drizzle::db::db2ANSI = (\"INT\"   =>  \"INTEGER\",\n\t\t\t   \"CHAR\"  =>  \"CHAR\",\n\t\t\t   \"REAL\"  =>  \"REAL\",\n\t\t\t   \"IDENT\" =>  \"DECIMAL\"\n                          );\n\n"
                  }
               ]
            }
         ]
      }
   ],
   "search_in_progress" : 0,
   "is_incomplete" : 0,
   "match" : {
      "distros" : "3",
      "files" : "6"
   }
}

There are "distros" : "3", "files" : "6" and just one result.

atoomic commented 6 years ago

thanks for reporting this, there is obviously something fundamentally wrong there, this needs investigation