Close
dtSearch Engine API for Java
macOS Platform

Using the dtSearch Engine for Java -- macOS 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 ~/Applications/dtSearchEngine.app/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. 

Under macOS, the binary executable is libdtsearch64.dylib, which must be accessed through a symbolic link named libdtsjava.dylib (or, if you prefer, you can just make a copy of the file with this name). To initialize the symbolic link, go to the bin64 folder and execute the makeLinksMacOS.sh script, like this:

cd ~/Applications/dtSearchEngine.app/bin64 ./makeLinksMacOS.sh

Samples 

A sample application is provided in ~/Applications/dtSearchEngine.app/examples/java/JavaDemo. To run the JavaDemo sample, open a Terminal window and execute the following commands:

cd ~/Applications/dtSearchEngine.app/examples/java ./runJavaDemo64.sh

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.