Created
August 19, 2014 07:23
-
-
Save whatvn/d54f038fbdebb5ff0607 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String seedUrl = "www.google.com www.blogger.com"; | |
_logger.info("Processing url [{}]", seedUrl); | |
Random random = new Random(); | |
String batchId = String.valueOf(random.nextInt()); | |
Configuration nutchConfiguration = NutchConfiguration.create(); | |
nutchConfiguration.set(BATCH_ID, batchId); | |
String solrUrl = nutchConfiguration.get(SOLR_URL); | |
String crawlArgs = String.format("-seedurl %s -depth 5 -topN 10", seedUrl); | |
// Run Crawl tool | |
ToolRunner.run(nutchConfiguration, new Crawler(), | |
tokenize(crawlArgs)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment