Stefan Groschupf wrote:

Hi Michi,
what is your motivation for that?


well, if you misconfigure searcher.dir within nutch-default.xml and
use NutchBean from bin/nutch then it just tells you that no hits have
been found and the log file (logs/hadoop.log) doesn't say anything
about a misconfigured searcher.dir either.

So, it can be very confusing, especially for beginners, because one
starts scratching and looking what might be the problem and actually
the problem is quite simple.

Enough motivation ;-) ?

HTH

Michi


Stefan
Am 25.08.2006 um 06:52 schrieb Michael Wechner:

Hi

I think it would be very useful if the NutchBean would check if the crawl dir exists and throw at least a warning
in case it doesn't:

Index: nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java
===================================================================
--- nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java (Revision 436787) +++ nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java (Arbeitskopie)
@@ -95,6 +95,9 @@
        if (dir == null) {
            dir = new Path(this.conf.get("searcher.dir", "crawl"));
        }
+       if (!new java.io.File(dir.toString()).exists()) {
+ LOG.warn("No such directory: " + new java.io.File (dir.toString()));
+        }
        Path servers = new Path(dir, "search-servers.txt");
        if (fs.exists(servers)) {
            if (LOG.isInfoEnabled()) {


WDYT?

Thanks

Michi

--
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                        [EMAIL PROTECTED]
+41 44 272 91 61



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec Inc.
Menlo Park, California
http://www.101tec.com






--
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                        [EMAIL PROTECTED]
+41 44 272 91 61

Reply via email to