Last Reviewed: July 19, 2021
Applies to: dtSearch Engine 7
The dtSearch Engine has two .NET APIs, one for the older .NET Framework (.NET 4.x), and one for the newer .NET 5/.NET Core. The newer API is based on the .NET Standard 2.0 specification and is described in the documentation as the ".NET Standard API" although in practice it will generally be used for .NET 5 and .NET Core.
Both APIs rely on the dtSearch Engine native library and an API wrapper. The older .NET Framework 4.x API requires dtSearchNetApi4.dll (the API wrapper) and dtengine64.dll (the native library). The .NET Standard API relies on dtSearchNetStdApi.dll (the API wrapper) and dtSearchEngine.dll (the Windows native library), libdtSearchEngine.so (the Linux native library), or libdtSearchEngine.dylib (the macOS native library).
API documentation for the .NET Standard API is posted here. Sample code is included with the dtSearch Engine versions 7.90 and later. Additionally, an ASP.NET Core demo showing faceted search and multicolor hit-highlighting is available here. Please select "SEC Filings" to see the faceted search portion of the demo. An article describing the demo's sample code is available here.
The dtSearch Engine for Windows SDK includes the Windows and UWP versions of the .NET Standard API. The dtSearch Engine for Linux SDK includes the Linux version of the NET Standard API. The macOS SDK includes the macOS version of the .NET Standard API.
.NET Standard is a common set of .NET APIs across all .NET platforms, including .NET Core, Xamarin, Mono, the .NET Framework for Windows, and UWP. For more information about .NET Standard, please see:
.NET Standard - Demystifying .NET Core and .NET Standard
The dtSearch .NET Standard API requires both the .NET Standard API wrapper, dtSearchNetStdApi.dll, and a native library for the specific environment where it runs. Therefore, it is only supported where the dtSearch Engine native library is available.
The native library versions currently available are:
Windows - x86 and x86_64
Windows UWP - x86 and x86_64
Linux - 64-bit x86_64
macOS - 64-bit x86_64
The following are currently only supported under Windows and Linux:
External Language Analyzer API
External File Parser API
External Thesaurus API
RAR archive support
For each platform, the .NET Standard API is treated like other redistributable components for that platform.
The Windows, Linux, and macOS versions are licensed separately.
The APIs are very similar but there are a small number of differences. This article summarizes the changes: "Changes from dtSearchNetApi4.dll."
Another important difference is the type of DLL. dtSearchNetApi4.dll is a mixed-mode DLL, which means that it has a 32-bit and a 64-bit version and requires certain MFC and CRT redistributables. dtSearchNetStdApi.dll is a cross-platform library, so it does not depend on anything except .NET and is identical on all platforms.
The filename of the native library has to be the same on all platforms (except for the extension and the "lib" prefix used on Unix-based platforms), because of the way .NET Standard interfaces with native libraries.
dtSearchNetStdApi.dll uses P/Invoke to call the dtSearch Engine, and is identical on all platforms. The same binary file runs in Windows, Linux, and MacOS.
P/Invoke does not have a fully cross-platform mechanism to vary the name of the native library called depending on the platform, so the name has to be "dtSearchEngine" on all platforms, except that the conventions for each platform for shared library names are used. Therefore, under Windows the shared library is dtSearchEngine.dll, under Linux it is libdtSearchEngine.so, and under MacOS it is libdtSearchEngine.dylib. All of the different dtSearchEngine native libraries are installed under the dtSearch engine\lib folder in subfolders organized by platform and CPU. (There is a way to vary the native library by platform, SetDllImportResolver, but it is only supported in a subset of the environments where .NET Standard 2.0 applies.)