Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ruebot committed Oct 12, 2017
1 parent c680725 commit f26f423
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Expand Up @@ -353,7 +353,7 @@ public SolrRecord extract( String archiveName, ArchiveRecord record, boolean isT
// Add user supplied Archive-It Solr fields and values:
// -----------------------------------------------------
solr.setField( SolrFields.INSTITUTION, WARCIndexerCommand.institution );
solr.setField( SolrFields.COLLECTION_NAME, WARCIndexerCommand.collection_name );
solr.setField( SolrFields.COLLECTION, WARCIndexerCommand.collection_name );
solr.setField( SolrFields.COLLECTION_ID, WARCIndexerCommand.collection_id );

// --- Basic headers ---
Expand Down
Expand Up @@ -90,7 +90,7 @@ public class WARCIndexerCommand {
private static boolean debugMode = false;

public static String institution;
public static String collection_name;
public static String collection;
public static String collection_id;

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public static void main( String[] args ) throws NoSuchAlgorithmException, IOExce
options.addOption("d", "disable_commit", false,
"Disable client side commits (speeds up indexing at the cost of flush guarantee).");
options.addOption("i", "institution", true, "Institution.");
options.addOption("n", "collection_name", true, "Collection name.");
options.addOption("n", "collection", true, "Collection.");
options.addOption("u", "collection_id", true, "Collection ID.");

try {
Expand Down Expand Up @@ -213,7 +213,7 @@ public static void main( String[] args ) throws NoSuchAlgorithmException, IOExce
}

if (line.hasOption("n")) {
collection_name = line.getOptionValue("n");
collection = line.getOptionValue("n");
}

if (line.hasOption("u")) {
Expand All @@ -225,7 +225,7 @@ public static void main( String[] args ) throws NoSuchAlgorithmException, IOExce

parseWarcFiles(configFile, outputDir, gzip, solrUrl, cli_args,
isTextRequired, slashPages, batchSize, annotationsFile,
disableCommit, institution, collection_name, collection_id);
disableCommit, institution, collection, collection_id);

} catch (org.apache.commons.cli.ParseException e) {
log.error("Parse exception when processing command line arguments: "+e);
Expand All @@ -246,7 +246,7 @@ public static void main( String[] args ) throws NoSuchAlgorithmException, IOExce
public static void parseWarcFiles(String configFile, String outputDir, boolean gzip,
String solrUrl, String[] args, boolean isTextRequired,
boolean slashPages, int batchSize, String annotationsFile,
boolean disableCommit, String institution, String collection_name,
boolean disableCommit, String institution, String collection,
String collection_id)
throws NoSuchAlgorithmException,
TransformerFactoryConfigurationError, TransformerException,
Expand Down
2 changes: 1 addition & 1 deletion warc-indexer/src/main/java/uk/bl/wa/solr/SolrFields.java
Expand Up @@ -148,6 +148,6 @@ public interface SolrFields {

//User supplied Archive-It fields
public static final String INSTITUTION = "institution";
public static final String COLLECTION_NAME = "collection_name";
public static final String COLLECTION = "collection";
public static final String COLLECTION_ID = "collection_id";
}
1 change: 0 additions & 1 deletion warc-indexer/src/main/solr/solr/discovery/conf/schema.xml
Expand Up @@ -171,7 +171,6 @@

<!-- User supplied Archive-It fields: -->
<field name="institution" type="string" indexed="true" multiValued="false" docValues="true"/>
<field name="collection_name" type="string" indexed="true" multiValued="false" docValues="true"/>
<field name="collection_id" type="string" indexed="true" multiValued="false" docValues="true"/>
<!--:User supplied Archive-It fields -->

Expand Down

0 comments on commit f26f423

Please sign in to comment.