|
dtSearch Text Retrieval Engine -- Java API
|
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.
For general information on using the dtSearch Engine, see the Overviews section in dtSearchApiRef.chm.
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.
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.
Under Linux, the binary executable is libdtsearch.so, which must be accessed through a symbolic link named libdtsjava.so. libdtsjava.so must be in a folder that is on the LD_LIBRARY_PATH, or you will get an "Unsatisfied Link" exception when you try to use the dtSearch Engine classes in Java. You can also copy the dtSearch .so files to your /usr/local/lib folder, or use ldconfig to make them accessible on your system.
A sample application is provided in examples\java\jdemo. To run the jdemo sample, execute the following command-line from the dtSearch Engine examples\java\classes folder:
[Windows]
java -cp dtSearchEngine.jar;jdemo.jar jdemo.Application
[Linux -- use colon (:) instead of semicolon (;)]
java -cp dtSearchEngine.jar:jdemo.jar jdemo.Application
A second sample application, dsource, demonstrates use of the DataSource interface to add fields to documents being indexed.
|
Copyright (c) 1998-2008 dtSearch Corp. All rights reserved.
|