I'm getting this error when I try to run a command line nutch-API based search 
app:
IllegalArgumentException: plugin.folders is not defined
Any suggestions?


This is the command:
java -cp <many jars>:$NUTCH_HOME/conf:. SearchApp a_search_string

I looked at this post:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg08241.html
and saw advice to put the conf directory in the CLASSPATH, which I did as you 
see above, and to also modify nutch-site.xml to contain a line for 
plugin.folders, which I also did:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<!-- I'm setting this to an absolute path for the SearchApp sample -->
<property>
  <name>plugin.folders</name>
  <value>/usr/local/nutch-2007-06-27_06-52-44/plugins</value>
  <description>Directories where nutch plugins are located.  Each
  element may be a relative or absolute path.  If absolute, it is used
  as is.  If relative, it is searched for on the classpath.</description>
</property>

--

Here's SearchApp.java:

import org.apache.hadoop.conf.Configuration;
import java.io.IOException;
import org.apache.nutch.searcher.Hit;
import org.apache.nutch.searcher.HitDetails;
import org.apache.nutch.searcher.Hits;
import org.apache.nutch.searcher.NutchBean;
import org.apache.nutch.searcher.Query;

public class SearchApp {

  private static final int NUM_HITS = 10;

  public static void main(String[] args)
      throws IOException {

    if (args.length == 0) {
      String usage = "Usage: SearchApp query";
      System.err.println(usage);
      System.exit(-1);
    }

    Configuration conf = new Configuration();
    NutchBean bean = new NutchBean(conf);
    Query query = Query.parse(args[0], conf);
    query.addRequiredTerm(args[0]);
    Hits hits = bean.search(query, NUM_HITS);

    for (int i = 0; i < hits.getLength(); i++) {
      Hit hit = hits.getHit(i);
      HitDetails details = bean.getDetails(hit);

      String title = details.getValue("title");
      String url = details.getValue("url");
      String summary =
        bean.getSummary(details, query).toString();

      System.out.print(title);
      System.out.print(" (");
      System.out.print(url);
      System.out.println(")");
      System.out.println("\t" + summary);
    }
  }
}






       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Nutch-general mailing list
Nutch-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nutch-general

Reply via email to