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

DataSource2 provides a way for data source indexing applications to obtain information about each document that is indexed, and provides better support for indexing binary data than DataSource.

Class Hierarchy
public abstract class DataSource2 implements com.dtsearch.engine.DataSource;
File

DataSource2.java

Remarks

If an IndexJob.dataSourceToIndex is based on DataSource2 instead of DataSource, then on each call to getNextDoc, the application can call getWordCount, getDocId, and getTypeId to obtain information on the previously-indexed document. 

Additionally, the data source can return binary data (such as document files) using setDocBytes() without the need to create a temporary file.

Group
Methods
Method 
Description 
Each time getNextDoc() is called, wasDocError will return true if there was an error processing the previous document, such as a file parsing error, and getDocError() will return the error message. 
Each time getNextDoc() is called, getDocId() will return the doc id of the last document indexed. 
Each time getNextDoc() is called, getDocTypeId() will return an integer identifying the file type of the last document indexed 
Each time getNextDoc() is called, getDocWordCount() will return the number of words in the last document indexed 
 
Use setDocBytes to provide an array of bytes for dtSearch to use as the binary contents of this document. 
Each time getNextDoc() is called, wasDocError() will return true if there was an error processing the previous document, such as a file parsing error, and getDocError() will return the error message. 
Legend
 
Method 
Links
You are here: Interfaces > DataSource2 Class
Copyright (c) 1998-2012 dtSearch Corp. All rights reserved.