How to Overwrite Preview Status Value

To overwrite the preview status value, follow these steps:

  1. Navigate to the SmartHub administration page at http(s)://<web-app-url>/_admin.
  2. Select the search engine for which you want this change.
  3. Click on the "ADD RESULTS TUNING" link.
  4. From the drop-down menu select "Results Scripting Processor".
  5. Provide a name for this Tuning stage.
  6. In the "Referenced Assemblies" section add:

    BAInsight.Longitude.Federator.Runtime
  7. In the "Imported Namespaces" section add:

    BAInsight.Longitude.Federator.Runtime.Misc
  8. In the "Script" section call the SearchResultsHelper.AddFakeMetadata function and modify the PreviewStatusValue to:

    1. 1 - if you don't want to generate previews for the documents:
      Example:SearchResultsHelper.AddFakeMetadata(Results,"PreviewStatusValue","1",true,true);
    2. 2 - Generate preview on demand.
      Example:SearchResultsHelper.AddFakeMetadata(Results,"PreviewStatusValue","2",true,true);
  9. Compile and Save.
  10. Run an iisreset command in order to clear the preview statuses from the cache.