org.apache.nutch.tools
Class PruneIndexTool.PrintFieldsChecker

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

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

This checker's main function is just to print out selected field values from each document, just before they are deleted.

Author:
Andrzej Bialecki <ab@getopt.org>

Constructor Summary
PruneIndexTool.PrintFieldsChecker(PrintStream ps, String[] fields)
           
 
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.PrintFieldsChecker

public PruneIndexTool.PrintFieldsChecker(PrintStream ps,
                                         String[] fields)
Parameters:
ps - an instance of PrintStream to print the information to
fields - a list of Lucene index field names. Values from these fields will be printed for every matching document.
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