Optimizations and Advanced Configuration

Blocking Unnecessary Similar Documents Requests

If it is not necessary to execute specific Similar Documents requests against the search backends, for example Similar News or Entities results injection, such requests can be skipped.

To prevent Similar Documents requests against your search backend The search engine your SmartHub instance uses to perform queries. SmartHub can be configured to use more than one search engine.(s), use a Similar Documents Query Processor pipeline stage Pipeline stages offer uniformity to the end user. Various functions include mapping names and values to match local refinements..

The following code checks the caller ID (Content-by-Search ID) and if it targets external content, the backends are bypassed.

This is done by setting the SkipFederation flag to true in the SearchQuery object.

Content by Search ID
Copy
SimilarDocumentsRequest similarDocRequest;
try
{
similarDocRequest = SimilarDocumentsUtil.GetSimilarDocumentsRequestFromQuery(Query);
 
 if(similarDocRequest.CallerId == "News" || similarDocRequest.CallerId == "Entities" ) 
 Query.SkipFederation=true;
 
}
catch
{
//handle error
 return;
}