Close
dtSearch Engine API for Java
Windows Platform

Using the dtSearch Engine for Java -- Windows Platform 

The Java interface to the dtSearch Engine is based on the Java Native Interface (JNI). Therefore, both the Java classes and a platform-specific binary executable are needed to use it. The Java classes are in examples\java\classes\dtSearchEngine.jar, which must be on the CLASSPATH. Adding the dtSearch Engine examples\java\classes folder to the CLASSPATH, or copying its contents to a folder on the CLASSPATH, will make these classes available in Java. 

Java version or later 1.4.1 is required. 

Windows platform (32-bit) 

Under 32-bit Windows, the dtSearch Java API requires dtsjava.dll, which in turn uses the dtSearch Engine DLL, dten600.dll. These two DLLs are installed in the dtSearch Engine bin folder. Both must be located in a folder that is listed in the PATH environment variable so the Java run-time can find them. 

Windows platform (64-bit) 

Under 64-bit Windows, the dtSearch Java API requires dtsjava.dll, which in turn uses the dtSearch Engine DLL, dtengine64.dll. These two DLLs are installed in the dtSearch Engine bin64 folder. Both must be located in a folder that is listed in the PATH environment variable so the Java run-time can find them. 

Note: Both the 32-bit and the 64-bit dtsjava.dll have the same name. The version you use must match the Java version you are using, so under 64-bit Java you should use the 64-bit version of dtsjava.dll. To ensure that the correct version is used with the Java version you have, set the system PATH so the correct dtSearch folder (bin64 or bin) comes first. For example, to use the 64-bit version, set up your system path with C:\Program Files\dtSearch Developer\bin64 ahead of C:\Program Files\dtSearch Developer\bin. 

Samples 

A sample application is provided in examples\java\JavaDemo. To run the JavaDemo sample, execute the following command-line from the C:\Program Files\dtSearch Developer\examples\java\classes folder:

java -cp dtSearchEngine.jar;JavaDemo.jar JavaDemo.Application

A second sample application, dsource, demonstrates use of the DataSource interface to add fields to documents being indexed.

Additional Resources

For general information on using the dtSearch Engine API, such as the search request syntax, procedures for building and maintaining indexes, and options settings, see the Overviews section in dtSearchApiRef.chm. 

Additional developer documentation is posted on the External linkdtSearch technical support site.