org.apache.lucene.ant

Class IndexTask

public class IndexTask extends Task

Ant task to index files with Lucene

Author: Erik Hatcher

Nested Class Summary
static classIndexTask.AnalyzerType
static classIndexTask.HandlerConfig
Constructor Summary
IndexTask()
Creates new instance
Method Summary
voidaddConfig(IndexTask.HandlerConfig config)
Sets custom properties for a configurable document handler.
voidaddFileset(FileSet set)
Adds a set of files (nested fileset attribute).
voidexecute()
Begins the indexing
voidsetAnalyzer(IndexTask.AnalyzerType type)
Sets the analyzer based on the builtin Lucene analyzer types.
voidsetAnalyzerClassName(String classname)
voidsetDocumentHandler(String classname)
Sets the documentHandler attribute of the IndexTask object
voidsetIndex(File indexDir)
Specifies the directory where the index will be stored
voidsetMergeFactor(int mergeFactor)
Sets the mergeFactor attribute of the IndexTask object
voidsetOverwrite(boolean overwrite)
Sets the overwrite attribute of the IndexTask object
voidsetUseCompoundIndex(boolean useCompoundIndex)
If creating a new index and this is set to true, the index will be created in compound format.

Constructor Detail

IndexTask

public IndexTask()
Creates new instance

Method Detail

addConfig

public void addConfig(IndexTask.HandlerConfig config)
Sets custom properties for a configurable document handler.

addFileset

public void addFileset(FileSet set)
Adds a set of files (nested fileset attribute).

Parameters: set FileSet to be added

execute

public void execute()
Begins the indexing

Throws: BuildException If an error occurs indexing the fileset

setAnalyzer

public void setAnalyzer(IndexTask.AnalyzerType type)
Sets the analyzer based on the builtin Lucene analyzer types.

UNKNOWN: Enforce analyzer and analyzerClassName to be mutually exclusive

setAnalyzerClassName

public void setAnalyzerClassName(String classname)

setDocumentHandler

public void setDocumentHandler(String classname)
Sets the documentHandler attribute of the IndexTask object

Parameters: classname The new documentHandler value

setIndex

public void setIndex(File indexDir)
Specifies the directory where the index will be stored

setMergeFactor

public void setMergeFactor(int mergeFactor)
Sets the mergeFactor attribute of the IndexTask object

Parameters: mergeFactor The new mergeFactor value

setOverwrite

public void setOverwrite(boolean overwrite)
Sets the overwrite attribute of the IndexTask object

Parameters: overwrite The new overwrite value

setUseCompoundIndex

public void setUseCompoundIndex(boolean useCompoundIndex)
If creating a new index and this is set to true, the index will be created in compound format.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.