Skip to content

Commit

Permalink
Hack up a script to reindex all releases of a dist
Browse files Browse the repository at this point in the history
useful for when we change the indexer.
  • Loading branch information
rwstauner committed May 17, 2014
1 parent 491d114 commit 81acd60
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/reindex_all_releases_of_a_dist
@@ -0,0 +1,16 @@
#!/bin/bash

cd "`dirname $0`"
cd ..

dist="$1"
url_field=download_url

cmd="bin/metacpan release --level debug --detect_backpan"

curl -s "http://api.metacpan.org/v0/release/_search" \
-d '{ "fields": ["download_url"], "filter": {"term": {"distribution": "'"$dist"'"}}, "size": 5000, "sort": ["date"] }' \
| perl -lne 'print $1 if /"download_url"\s*:\s*"([^"]+)"/' \
| xargs --no-run-if-empty -n 1 $cmd

$cmd --latest

0 comments on commit 81acd60

Please sign in to comment.