1 |
On 13 May 2012 07:43, Torsten Veller <tove@g.o> wrote: |
2 |
> * Corentin Chary <corentin.chary@×××××.com>: |
3 |
>> On Sat, Apr 21, 2012 at 03:33:18PM +1200, Kent Fredric wrote: |
4 |
>> > { "term": { "status":"latest"} }, |
5 |
>> > { "term": { "module.authorized":"true"}} |
6 |
> |
7 |
> What does this mean? |
8 |
> - "latest"? this term looks like maintenance work. |
9 |
> - what is "authorized"? |
10 |
|
11 |
"latest" means that it will fetch metadata for whatever is deemed the |
12 |
most recent non-dev release, which is really the only sane option to |
13 |
go for if you want a list of modules that currently pertain to the |
14 |
distribution. You could request *all* releases and then find a union |
15 |
of elements ... but that would be both erroneous and very time |
16 |
consuming. |
17 |
|
18 |
> It doesn't even list "Moose" for Moose? |
19 |
|
20 |
Its probably falling outside the initial 10 results, I forgot it did that, |
21 |
|
22 |
> 02packages.details.txt.gz lists 72 package names for Moose-2.0602. |
23 |
> |
24 |
|
25 |
Need to bolt on a { "size": 100 } to the query to expand how may |
26 |
results it will return. |
27 |
|
28 |
curl -XPOST 'http://api.metacpan.org/module/_search' -d ' |
29 |
{ |
30 |
"fields": [ |
31 |
"module.name", |
32 |
"release" |
33 |
], |
34 |
"query": { |
35 |
"constant_score": { |
36 |
"filter" : { |
37 |
"and" : [ |
38 |
{ "term": { "distribution":"Moose" } }, |
39 |
{ "term": { "status":"latest"} }, |
40 |
{ "term": { |
41 |
"mime":"text/x-script.perl-module"}}, |
42 |
{ "term": { "indexed":"true"}}, |
43 |
{ "term": { "module.authorized":"true"}} |
44 |
] |
45 |
|
46 |
} |
47 |
} |
48 |
}, |
49 |
"size": 100 |
50 |
} |
51 |
|
52 |
^ that | grep module.name | wc -l # 83 |
53 |
|
54 |
-- |
55 |
Kent |
56 |
|
57 |
perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, |
58 |
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" |
59 |
|
60 |
http://kent-fredric.fox.geek.nz |