Close
dtSearch .NET Standard API 2023.02
Changes from dtSearchNetApi4.dll

The dtSearch .NET Standard API is very similar to the .NET Framework API in dtSearchNetApi4.dll, but there are some changes.

Threading

Instead of ExecuteInThread/IsThreadDone, use async/await. 

SearchJob, SearchResults, and SearchFilter 

The searching API has been changed slightly to be easier to use with "using" clauses. The caller allocates both the SearchJob and the SearchResults, and then passes the SearchResults in the Execute() method. Example:

// Allocate SearchJob and SearchResults to store results using (dtSearch.Engine.SearchJob searchJob = new dtSearch.Engine.SearchJob()) using (SearchResults results = new SearchResults()) { searchJob.Request = searchRequest.Text; searchJob.IndexesToSearch.Add(indexPath.Text); searchJob.MaxFilesToRetrieve = 100; searchJob.SearchFlags = SearchFlags.dtsSearchDelayDocInfo; searchJob.Execute(results); if (searchJob.Errors.Count > 0) // ... display error messages ... else { // ... display search results ... } }

Generation of a SearchFilter works similarly. The caller allocates the SearchFilter and then passes it as a second parameter to SearchJob.Execute to generate a SearchFilter from the search results. For sample code see SearchJob Class

 

StringCollection replaced with List<string>

Where the API uses a set of string values, the newer and more standard List<string> is used instead of the older StringCollection. 

Redundant properties eliminated 

IndexJob.CreateAccentSensitive, CreateCaseSensitive, and CreateRelativePaths are all redundant with the equivalent flags in IndexJob.IndexingFlags

In SearchResults, DocName, DocHitCount, and DocHits are redundant with CurrentItem.DocName, CurrentItem.DocHitCount, and CurrentItem.DocHits. 

SearchResults.MakePdfHighlightFile is redundant with MakePdfWebHighlightFile. 

Server.ConvertPath is redundant with the ASP.NET Server.MapPath method.