org.apache.lucene.ant

## Class IndexTask

- java.lang.Object
- - org.apache.tools.ant.ProjectComponent
  - - org.apache.tools.ant.Task
    - - org.apache.lucene.ant.IndexTask

- All Implemented Interfaces:
    java.lang.Cloneable

      public class IndexTask
      extends org.apache.tools.ant.Task

  Ant task to index files with Lucene

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IndexTask.AnalyzerType`
    `static class` | `IndexTask.HandlerConfig`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Vector` | `rcs` resources

    - ### Fields inherited from class org.apache.tools.ant.Task

      `target, taskName, taskType, wrapper`

    - ### Fields inherited from class org.apache.tools.ant.ProjectComponent

      `description, location, project`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexTask()` Creates new instance

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(org.apache.tools.ant.types.ResourceCollection res)` Add a collection of files to copy.
    `void` | `addConfig(IndexTask.HandlerConfig config)` Sets custom properties for a configurable document handler.
    `void` | `addFileset(org.apache.tools.ant.types.FileSet set)` Adds a set of files (nested fileset attribute).
    `void` | `execute()` Begins the indexing
    `void` | `setAnalyzer(IndexTask.AnalyzerType type)` Sets the analyzer based on the builtin Lucene analyzer types.
    `void` | `setAnalyzerClassName(java.lang.String classname)`
    `void` | `setDocumentHandler(java.lang.String classname)` Sets the documentHandler attribute of the IndexTask object
    `void` | `setIndex(java.io.File indexDir)` Specifies the directory where the index will be stored
    `void` | `setMergeFactor(int mergeFactor)` Sets the mergeFactor attribute of the IndexTask object
    `void` | `setOverwrite(boolean overwrite)` Sets the overwrite attribute of the IndexTask object
    `void` | `setUseCompoundIndex(boolean useCompoundIndex)` If creating a new index and this is set to true, the index will be created in compound format.

    - ### Methods inherited from class org.apache.tools.ant.Task

      `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`

    - ### Methods inherited from class org.apache.tools.ant.ProjectComponent

      `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### rcs

          protected java.util.Vector rcs

      resources

  - ### Constructor Detail

    - #### IndexTask

          public IndexTask()

      Creates new instance

  - ### Method Detail

    - #### setIndex

          public void setIndex(java.io.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.

    - #### setDocumentHandler

          public void setDocumentHandler(java.lang.String classname)

      Sets the documentHandler attribute of the IndexTask object
      Parameters:
        `classname` - The new documentHandler value

    - #### setAnalyzer

          public void setAnalyzer(IndexTask.AnalyzerType type)

      Sets the analyzer based on the builtin Lucene analyzer types. TODO: Enforce analyzer and analyzerClassName to be mutually exclusive

    - #### setAnalyzerClassName

          public void setAnalyzerClassName(java.lang.String classname)

    - #### addFileset

          public void addFileset(org.apache.tools.ant.types.FileSet set)

      Adds a set of files (nested fileset attribute).
      Parameters:
        `set` - FileSet to be added

    - #### add

          public void add(org.apache.tools.ant.types.ResourceCollection res)

      Add a collection of files to copy.
      Parameters:
        `res` - a resource collection to copy.
      Since:
        Ant 1.7

    - #### addConfig

          public void addConfig(IndexTask.HandlerConfig config)
                         throws org.apache.tools.ant.BuildException

      Sets custom properties for a configurable document handler.
      Throws:
        `org.apache.tools.ant.BuildException`

    - #### execute

          public void execute()
                       throws org.apache.tools.ant.BuildException

      Begins the indexing
      Overrides:
        `execute` in class `org.apache.tools.ant.Task`
      Throws:
        `org.apache.tools.ant.BuildException` - If an error occurs indexing the fileset

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.