Links
dtSearch Text Retrieval Engine -- Java API 7.70
IndexJob Class
Classes | Legend | Members | Methods | Send Feedback

The IndexJob object handles creation and updating of dtSearch indexes.

Class Hierarchy
public class IndexJob;
File

IndexJob.java

Remarks

To create or update an index, make an IndexJob, use the properties to describe the indexing task you want the engine to perform, and call the Execute method. IndexJob provides two ways to specify the text to be indexed: (1) the setIncludeFilters, setExcludeFilters, and setFoldersToIndex members let you specify directories and filename filters identifying a set of disk files to index, and (2) the DataSourceToIndex member lets you supply text data directly to the dtSearch Engine for indexing. dataSourceToIndex is useful for indexing data from non-file sources such as message stores, SQL databases, dynamically-generated data, or any non-file data accessible to your program.

Actions

The setActionXXX flags specify the actions you want the engine to perform. If more than one action is specified, the engine will perform the actions in the following order: create, removeDeleted, removeListed, add, compress, merge, verify. 

A brief summary of the meaning of each actionXXX flag is given below. For more information, see "Building and Maintaining Indexes" in the Overviews section. 

Add: Add documents to an existing index. 

Compress: Remove obsolete information from the index. 

Create: Create a new index. If an index already exists in the specified directory, the index will be destroyed and replaced with a new, empty index. 

RemoveDeleted: Check that each file in the index still exists on disk and remove from the index any files that no longer exist. 

RemoveListed: Remove the files listed in ToRemoveList from the index. 

Merge: Merge one or more indexes into the target index. Use setIndexPath to specify the location of the target index, and setIndexesToMerge to specify the location of the indexes to merge. Merging indexes combines two or more indexes into a single index, which contains any document that was in any of the merged indexes. If the same document appears in more than one of the merged indexes, only the most recent document will appear in the merged index. 

Verify: To verify an index, dtSearch scans all structures in the index and performs many detailed checks to validate all data in the index for consistency. 

 

Errors

After executing an IndexJob, call getErrors() to check for any errors that may have occurred during the job. 

 

Related Articles

Building and Maintaining Indexes in Overviews 

Database and Field Searching in Overviews (covers indexing databases)

Group
Methods
Method 
Description 
Performs the indexing job and returns 0 if the job is successful or -1 if an error occured. 
After an indexing job is done, the Errors property will contain a JobErrorInfo object with any error messages generated during the indexing job. 
Returns a table of values describing the index in IndexPath. 
Returns a number identifying the current indexing step in progress. 
Returns the percentage of the index job that has been completed. 
Add documents to an index. 
Compress an index. 
Create an index. 
Merge two or more indexes. 
Remove deleted documents from a index. 
Remove a list of documents from an index. 
Verify that an index is not damaged. 
Number of megabytes to index before committing the index update. 
Index will preserve accents when indexing words. 
Index will treat words with different capitalization as different words. 
Use relative rather than absolute paths in storing document locations. 
The dataSourceToIndex property provides a way to supply text to be indexed to the dtSearch Engine when the text is not accessible as a disk file. 
Specify that a list of fields should be indexed as enumerable fields. 
Files to skip during indexing. 
Space-delimited list of folders (or files) to index (add <+> after a folder name to include subfolders). 
Files to index in the folders listed in FoldersToIndex. 
List of indexes to merge into the target index (IndexPath). ActionMerge must be true for the merge to occur. 
IndexingFlags values controlling the indexing of documents 
Name of the index 
The directory where the index will be stored. 
MaxMemToUseMB controls the size of the memory buffers that dtSearch can use to sort words during indexing. 
If non-zero, the first doc id to assign to documents in this index. 
The statusHandler is an object that will receive status updates from the engine during indexing. 
The statusHandler2 is an object that implements the IIndexStatusHandler interface, to receive detailed information about the progress of an index update. 
Used to specify that the text in certain fields should be collected, stored in the index, and returned in searches. 
Folder to use instead of the index folder for temporary files during indexing. 
Set TimeoutSeconds to the maximum amount of time you want to permit the index job to run. 
Name of file containing list of files to remove from the index. 
Legend
 
Method 
Links
You are here: Classes > IndexJob Class
Copyright (c) 1998-2012 dtSearch Corp. All rights reserved.