The IndexJob object handles creation and updating of dtSearch indexes.
File: IndexJob.java
Package: com.dtsearch.engine
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. The value will be one of the following:... more | |
Returns the percentage of the index job that has been completed. This value can be used during a callback through the StatusHandler property. | |
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. Otherwise, accents are stripped from words being indexed. Stripping of accents is done using information in the dtSearch alphabet file. | |
Index will treat words with different capitalization as different words. (apple and Apple would be two different words.) | |
Name of file containing list of files to remove from the index. | |
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. You can use this to index databases or other non-file data. | |
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. | |
Name of the index | |
The directory where the index will be stored. The index will consist of a set of files named INDEX_*.IX. | |
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 | |
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. To specify the fields to be stored, set StoredFields to a space-delimited list of field names (quote any field names that contain spaces). The field names in the list can contain wildcards (* and ?). A set containing a single entry "*" would match all fields, causing the text of every field to be stored in the index. | |
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. The default value, zero, allows the index job to continue until cancelled or complete. | |
Name of file containing list of files to remove from the index. |
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.
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.
After executing an IndexJob, call getErrors() to check for any errors that may have occurred during the job.
Building and Maintaining Indexes in Overviews
Database and Field Searching in Overviews (covers indexing databases)