Smart Previews NLQ Integration

 

About

One Smart Previews function is to fetch search terms from a query and preview the terms when opening the viewer.

In the case of NLQ (see the How to Use Interactive Help section) queries are performed using natural language: “show me all of the P1 cases."

  • Searching for all of the words in the query is not done
  • Most of the words in the query are StopWords, and are therefore ignored
  • The remaining words are not things that are found in a document, but instead are words that describe the document
Tip: Smart Previews highlights the query keywords in the document viewer.

Those keywords are a combination of:

  • any non-StopWord in the query
    and
  • entities that are detected in the query

In general, the list of keywords which Smart Previews uses to search inside the preview when opening the viewer is created by:

  1. NLQ capability
    • Returns the entities detected in the query.
  2. Federator engine
    • Returns any non-stopword that is detected in the text:  
      • Property restrictions will not be highlighted
      • The stopwords are stored on disk so they can be altered, see How to Configure StopWords.
  3. Scripting engine
    • Returns any tag pushed/manipulated by the scripting stages so that users can push their own tags depending on the query executed.

Example: NLQ Query

In the following example an NLQ query is performed for the phrase "give me the shows."

  • Query entities are shown in the code (shown below on the left)
  • A QnA entry exists for the intent "Shows." (shown below on the right)

Keywords

  • Keywords are shown in a query result document page, below.

  • The list of keywords is as follows:

    • give
    • shows
    • sharepoint
    • service

      Note: The word "sharepoint" is not highlighted in the screenshot below, because it is not found in the document.
      A warning with this message is displayed for a few seconds when opening the viewer.

Example: Query Modified by the Pipeline Stages

In the following example SmartHub Tuning stages are used to modify a query. A SmartHub search engine is configured with the following two query pipeline stages: 

  • Query Scripting Processor
    • Modifies the query by appending at the end the "application" word:



  • Synonym Processor
    • Sets the following synonyms:



When querying the word "azure," a list of keywords are highlighted in the viewer that contain the following words:

  • azure
  • sql
  • application

Add Additional Keywords through Scripting Stages

You can add custom keywords to be highlighted when opening the document viewer through the scripting stages.

  • Adding additional keywords can be achieved by adding any of the following Tuning stages:

    • Query Scripting Processor:

    • Results Scripting Processor:


Note: The QueryTerms property is a Dictonary<string, List<string>> that contains a keyword and a list of synonyms for that word.

This list can be:

  • null

  • empty list

  • list with values