org.apache.nutch.tools
Class PruneIndexTool.StoreUrlsChecker

java.lang.Object
  extended by org.apache.nutch.tools.PruneIndexTool.StoreUrlsChecker
All Implemented Interfaces:
PruneIndexTool.PruneChecker
Enclosing class:
PruneIndexTool

public static class PruneIndexTool.StoreUrlsChecker
extends Object
implements PruneIndexTool.PruneChecker

This checker's main function is just to store the URLs of each document to be deleted in a text file.

Author:
Andrzej Bialecki <ab@getopt.org>

Constructor Summary
PruneIndexTool.StoreUrlsChecker(File out, boolean storeHomeUrl)
          Store the list in a file
 
Method Summary
 void close()
          Close the checker - this could involve flushing output files or somesuch.
 boolean isPrunable(Query q, IndexReader reader, int docNum)
          Check whether this document should be pruned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PruneIndexTool.StoreUrlsChecker

public PruneIndexTool.StoreUrlsChecker(File out,
                                       boolean storeHomeUrl)
                                throws Exception
Store the list in a file

Parameters:
out - name of the output file
Throws:
Exception
Method Detail

close

public void close()
Description copied from interface: PruneIndexTool.PruneChecker
Close the checker - this could involve flushing output files or somesuch.

Specified by:
close in interface PruneIndexTool.PruneChecker

isPrunable

public boolean isPrunable(Query q,
                          IndexReader reader,
                          int docNum)
                   throws Exception
Description copied from interface: PruneIndexTool.PruneChecker
Check whether this document should be pruned. NOTE: this method MUST NOT modify the IndexReader.

Specified by:
isPrunable in interface PruneIndexTool.PruneChecker
reader - index reader to read documents from
docNum - document ID
Returns:
true if the document should be deleted, false otherwise.
Throws:
Exception


Copyright © 2006 The Apache Software Foundation