#!/bin/sh
# delete if the directory already exists
rm -rf ~/.cowrc.d/0.1/indices/nutch
# create it before we add index data to it
mkdir -p ~/.cowrc.d/0.1/indices/nutch

# start crawling
sh bin/nutch crawl urls -dir ~/.cowrc.d/0.1/indices/nutch -depth 3

# please change the url below to specify the index, the following
# utility should use to add index data to
# few example values
# add index data into core0
# http://localhost:8080/solr/core0
# add index data into core1
# http://localhost:8080/solr/core1
sh bin/nutch solrindex http://localhost:8080/solr/$1 \
  ~/.cowrc.d/0.1/indices/nutch/crawldb ~/.cowrc.d/0.1/indices/nutch/linkdb \
  ~/.cowrc.d/0.1/indices/nutch/segments/*
