-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdumpEdaWdkBatchesForSolr
More file actions
executable file
·48 lines (31 loc) · 1.41 KB
/
dumpEdaWdkBatchesForSolr
File metadata and controls
executable file
·48 lines (31 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/perl
use lib "$ENV{GUS_HOME}/lib/perl";
use Getopt::Long;
use strict;
use DBI;
use SiteSearchData::Model::Utils;
my $BATCH_DIR_PREFIX = "solr-json-batch";
my ($wdkServiceUrl, $targetDir, $verbose);
&GetOptions("targetDir=s" => \$targetDir,
"wdkServiceUrl=s" => \$wdkServiceUrl,
"verbose!" => \$verbose);
$| = 1;
&usage unless ($targetDir && $wdkServiceUrl);
die "Error: targetDir '$targetDir' is not a directory\n" unless -d $targetDir;
my $gusProps = SiteSearchData::Model::Utils::getPropsFromFile("$ENV{GUS_HOME}/config/gus.config");
my $modelProps = SiteSearchData::Model::Utils::getPropsFromFile("$ENV{GUS_HOME}/config/SiteSearchData/model.prop");
SiteSearchData::Model::Utils::runWdkReport($wdkServiceUrl, $targetDir, $BATCH_DIR_PREFIX, "dataset-presenter", $modelProps->{PROJECT_ID});
SiteSearchData::Model::Utils::runWdkReport($wdkServiceUrl, $targetDir, $BATCH_DIR_PREFIX, "community-datasets", $modelProps->{PROJECT_ID});
print STDOUT "Done.\n";
exit 0;
sub usage {
die
"Dump EDA batches to be loaded into solr from data produced by the workflow.
usage: dumpEdaWdkBatchesForSolr --wdkServiceUrl SERVICE_URL --targetDir TARGET_DIR [--verbose]
Dump wdk records as Solr compatible Json
Dumps data in hard-coded set of batches:
- dataset-presenter
Connects to a running SiteSearchData wdk service to generate the reports.
Calls the createWdkRecordsSolrBatch command to do the work.
";
}