How to use the 64-bit version of the dtSearch Engine

Article: dts0217

Applies to: dtSearch Engine 7.53 and later

Introduction

The dtSearch Text Retrieval Engine has 64-bit and 32-bit APIs for use in C++, Java and .NET.  The APIs and index formats are identical between the 64-bit and 32-bit versions.  Additionally, a 64-bit version of the dtSearch Indexer, dtindexer64.exe, is included with dtSearch.

Installation

The 64-bit components are included with the dtSearch Developer setup and are installed by default in the C:\Program Files\dtSearch Developer\bin64 folder.   On 64-bit operating systems, the default installation folder is C:\Program Files (x86)\dtSearch Developer\bin64.  The setup program does not check for a 64-bit operating system or processor before installing the 64-bit components, so developers can build their applications on 32-bit systems if necessary.

Using the 64-bit API in C++

In C++, you can use the same header files and API that you would use with the 32-bit version.  Instead of linking with dten600.lib, link with dtengine64.lib.  Your application will require the 64-bit version of the dtSearch Engine, dtengine64.dll.  The C++ API does not depend on any MFC or CRT components.

Using the 64-bit API in .NET 4.x

A 64-bit version of dtSearchNetApi4.dll is installed in the bin64 folder.  To use the 64-bit version of the .NET interface, add a reference to this dtSearchNetApi4.dll to your project, instead of the 32-bit version of dtSearchNetApi4.dll in the bin folder.  The 64-bit .NET interface is identical to the 32-bit interface.

Conditional Project References

Web applications may need to support either x86 or x64 because of the way the Visual Studio build process works.  (While your web server may be 64-bit, Visual Studio uses a 32-bit web server internally, so the build will fail in 64-bit mode inside Visual Studio, even though the application is to be deployed to a 64-bit environment.)  To make a single project that can target x86 or x64, you can edit your project file (*.csproj, *.csxproj, or *.vbproj) in a text editor and replace the reference to dtSearchNetApi4.dll with conditional references, as follows:

<ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">

    <Reference Include="dtSearchNetApi4, Version=1.0.3846.20750, Culture=neutral, processorArchitecture=x86">

      <SpecificVersion>False</SpecificVersion>

      <HintPath>..\..\..\bin\dtSearchNetApi4.dll</HintPath>

    </Reference>

  </ItemGroup>

  <ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">

    <Reference Include="dtSearchNetApi4, Version=1.0.3846.20750, Culture=neutral, processorArchitecture=x86">

      <SpecificVersion>False</SpecificVersion>

      <HintPath>..\..\..\bin\dtSearchNetApi4.dll</HintPath>

    </Reference>

  </ItemGroup>

  <ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">

    <Reference Include="dtSearchNetApi4, Version=1.0.3846.20750, Culture=neutral, processorArchitecture=x64">

      <SpecificVersion>False</SpecificVersion>

      <HintPath>..\..\..\bin64\dtSearchNetApi4.dll</HintPath>

    </Reference>

  </ItemGroup>

  <ItemGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

    <Reference Include="dtSearchNetApi4, Version=1.0.3846.20750, Culture=neutral, processorArchitecture=x64">

      <SpecificVersion>False</SpecificVersion>

      <HintPath>..\..\..\bin64\dtSearchNetApi4.dll</HintPath>

    </Reference>

  </ItemGroup>  

Using the 64-bit API in Java

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. 

Windows
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. 

Linux

Under 64-bit Linux, the same dtSearchEngine.jar is used to provide the Java classes implementing the Java interface.  Instead of dtsjava.dll, 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.

Both the 32-bit and the 64-bit version of libdtsjava.so 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 libdtsjava.so.